Prompt: -- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000

Response:
function RayCast(startPos, vec, rayLength)
	local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
	if hitObject and hitPos then
		local distance = rayLength - (hitPos - startPos).magnitude
		if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
			-- there is a chance here for potential infinite recursion
			return RayCast(hitPos, vec, distance)
		end
	end
	return hitObject, hitPos
end

function TagHumanoid(humanoid, player)
	-- Add more tags here to customize what tags are available.
	while humanoid:FindFirstChild('creator') do
		humanoid:FindFirstChild('creator'):Destroy()
	end
	local creatorTag = Instance.new("ObjectValue")
	creatorTag.Value = player
	creatorTag.Name = "creator"
	creatorTag.Parent = humanoid
	DebrisService:AddItem(creatorTag, 1.5)

	local weaponIconTag = Instance.new("StringValue")
	weaponIconTag.Value = IconURL
	weaponIconTag.Name = "icon"
	weaponIconTag.Parent = creatorTag
end

local function CreateFlash()
	if FlashHolder then
		local flash = Instance.new('Fire', FlashHolder)
		flash.Color = Color3.new(0, 145 / 255, 255)
		flash.SecondaryColor = Color3.new(1, 0, 0)
		flash.Size = 0.3
		DebrisService:AddItem(flash, FireRate / 1.5)
	else
		FlashHolder = Instance.new("Part", Tool)
		FlashHolder.Transparency = 1
		FlashHolder.CanCollide= false
		FlashHolder.Size = Vector3.new(1, 1, 1)
		FlashHolder.Position = Tool.Handle.Position
		local Weld = Instance.new("ManualWeld")
		Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
		Weld.C1 = CFrame.new(0, 2.2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
		Weld.Part0 = FlashHolder
		Weld.Part1 = Tool.Handle
		Weld.Parent = FlashHolder
	end
end

local function CreateBullet(bulletPos)
	local bullet = Instance.new('Part', Workspace)
	bullet.FormFactor = Enum.FormFactor.Custom
	bullet.Size = Vector3.new(0.1, 0.1, 0.1)
	bullet.BrickColor = MyPlayer.TeamColor
	bullet.Shape = Enum.PartType.Ball
	bullet.CanCollide = false
	bullet.CFrame = CFrame.new(bulletPos)
	bullet.Anchored = true
	bullet.TopSurface = Enum.SurfaceType.Smooth
	bullet.BottomSurface = Enum.SurfaceType.Smooth
	bullet.Name = 'Bullet'
	DebrisService:AddItem(bullet, 2.5)
	local fire = Instance.new("Fire", bullet)
	fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
	fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
	fire.Size = 5
	fire.Heat = 0
	DebrisService:AddItem(fire, 0.2)
	return bullet
end

local function Reload()
	if not Reloading then
		Reloading = true
		-- Don't reload if you are already full or have no extra ammo
		if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
			if RecoilTrack then
				RecoilTrack:Stop()
			end
			if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
				if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
					WeaponGui.Crosshair.ReloadingLabel.Visible = true
				end
			end
			wait(ReloadTime)
			-- Only use as much ammo as you have
			local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
			AmmoInClip = AmmoInClip + ammoToUse
			SpareAmmo = SpareAmmo - ammoToUse
			UpdateAmmo(AmmoInClip)
		end
		Reloading = false
	end
end

function OnFire()
	if IsShooting then return end
	if MyHumanoid and MyHumanoid.Health > 0 then
		if RecoilTrack and AmmoInClip > 0 then
			RecoilTrack:Play()
		end
		IsShooting = true
		while LeftButtonDown and AmmoInClip > 0 and not Reloading do
			if Spread and not DecreasedAimLastShot then
				Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
				UpdateCrosshair(Spread)
			end
			DecreasedAimLastShot = not DecreasedAimLastShot
			if Handle:FindFirstChild('FireSound') then
				Handle.FireSound:Play()
			end
			CreateFlash()
			if MyMouse then
				local targetPoint = MyMouse.Hit.p
				local shootDirection = (targetPoint - Handle.Position).unit
				-- Adjust the shoot direction randomly off by a little bit to account for recoil
				shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
																(0.5 - math.random()) * 2 * Spread,
																(0.5 - math.random()) * 2 * Spread) * shootDirection
				local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
				local bullet
				-- Create a bullet here
				if hitObject then
					bullet = CreateBullet(bulletPos)
				end
				if hitObject and hitObject.Parent then
					local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
					if hitHumanoid then
						local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
						if MyPlayer.Neutral or (hitPlayer and hitPlayer.TeamColor ~= MyPlayer.TeamColor) then
							TagHumanoid(hitHumanoid, MyPlayer)
							hitHumanoid:TakeDamage(Damage)
							if bullet then
								bullet:Destroy()
								bullet = nil
								--bullet.Transparency = 1
							end
							Spawn(UpdateTargetHit)
						end
					end
				end

				AmmoInClip = AmmoInClip - 1
				UpdateAmmo(AmmoInClip)
			end
			wait(FireRate)
		end
		IsShooting = false
		if AmmoInClip == 0 then
			Reload()
		end
		if RecoilTrack then
			RecoilTrack:Stop()
		end
	end
end

local TargetHits = 0
function UpdateTargetHit()
	TargetHits = TargetHits + 1
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
		WeaponGui.Crosshair.TargetHitImage.Visible = true
	end
	wait(0.5)
	TargetHits = TargetHits - 1
	if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
		WeaponGui.Crosshair.TargetHitImage.Visible = false
	end
end

function UpdateCrosshair(value, mouse)
	if WeaponGui then
		local absoluteY = 650
		WeaponGui.Crosshair:TweenSize(
			UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
			Enum.EasingDirection.Out,
			Enum.EasingStyle.Linear,
			0.33)
	end
end

function UpdateAmmo(value)
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
		WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
		if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
			WeaponGui.Crosshair.ReloadingLabel.Visible = false
		end
	end
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
		WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
	end
end

function OnMouseDown()
	LeftButtonDown = true
	OnFire()
end

function OnMouseUp()
	LeftButtonDown = false
end

function OnKeyDown(key)
	if string.lower(key) == 'r' then
		Reload()
	end
end

function OnEquipped(mouse)
	RecoilAnim = WaitForChild(Tool, 'Recoil')
	FireSound  = WaitForChild(Handle, 'FireSound')

	MyCharacter = Tool.Parent
	MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
	MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
	MyTorso = MyCharacter:FindFirstChild('Torso')
	MyMouse = mouse
	WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
	if WeaponGui and MyPlayer then
		WeaponGui.Parent = MyPlayer.PlayerGui
		UpdateAmmo(AmmoInClip)
	end
	if RecoilAnim then
		RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
	end

	if MyMouse then
		-- Disable mouse icon
		MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
		MyMouse.Button1Down:connect(OnMouseDown)
		MyMouse.Button1Up:connect(OnMouseUp)
		MyMouse.KeyDown:connect(OnKeyDown)
	end
end


Prompt: --This script turns the light on at night and off in in the day!

Response:
b = script.Parent

local oh,om = 6,20	-- Open Time (hours,minutes)
local ch,cm = 17,45	-- Close Time (hours, minutes)

local l = game:service("Lighting")
if (om == nil) then om = 0 end
if (cm == nil) then cm = 0 end

function TimeChanged()
	local ot = (oh + (om/60)) * 60
	local ct = (ch + (cm/60)) * 60
	if (ot < ct) then
		if (l:GetMinutesAfterMidnight() >= ot) and (l:GetMinutesAfterMidnight() <= ct) then
b.Enabled = false
		else
b.Enabled = true
		end
	elseif (ot > ct) then
		if (l:GetMinutesAfterMidnight() >= ot) or (l:GetMinutesAfterMidnight() <= ct) then
b.Enabled = false
		else
b.Enabled = true
		end
	end
end

TimeChanged()
game.Lighting.Changed:connect(function(property)
			if (property == "TimeOfDay") then
				TimeChanged()
			end
		end)


Prompt:
--Rescripted by Luckymaxer
--Updated for R15 avatars by StarWars

Response:
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Mesh = Handle:WaitForChild("Mesh")

Players = game:GetService("Players")
Debris = game:GetService("Debris")

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

BaseUrl = "http://www.roblox.com/asset/?id="

Meshes = {
	GrappleWithHook = 33393806,
	Grapple = 30308256,
	Hook = 30307623,
}

Animations = {
	Crouch = {Animation = Tool:WaitForChild("Crouch"), FadeTime = 0.25, Weight = nil, Speed = nil},
	R15Crouch = {Animation = Tool:WaitForChild("R15Crouch"), FadeTime = 0.25, Weight = nil, Speed = nil}
}

Sounds = {
	Fire = Handle:WaitForChild("Fire"),
	Connect = Handle:WaitForChild("Connect"),
	Hit = Handle:WaitForChild("Hit"),
}

for i, v in pairs(Meshes) do
	Meshes[i] = (BaseUrl .. v)
end

local BaseRopeConstraint = Instance.new("RopeConstraint")
BaseRopeConstraint.Thickness = 0.2
BaseRopeConstraint.Restitution = 1
BaseRopeConstraint.Color = BrickColor.new("Really black")

BasePart = Create("Part"){
	Material = Enum.Material.Plastic,
	Shape = Enum.PartType.Block,
	TopSurface = Enum.SurfaceType.Smooth,
	BottomSurface = Enum.SurfaceType.Smooth,
	Size = Vector3.new(0.2, 0.2, 0.2),
	CanCollide = true,
	Locked = true,
}

BaseRope = BasePart:Clone()
BaseRope.Name = "Effect"
BaseRope.BrickColor = BrickColor.new("Bright red")
BaseRope.Anchored = true
BaseRope.CanCollide = false
Create("CylinderMesh"){
	Scale = Vector3.new(1, 1, 1),
	Parent = BaseRope,
}

BaseGrappleHook = BasePart:Clone()
BaseGrappleHook.Name = "Projectile"
BaseGrappleHook.Transparency = 0
BaseGrappleHook.Size = Vector3.new(1, 0.4, 1)
BaseGrappleHook.Anchored = false
BaseGrappleHook.CanCollide = true
Create("SpecialMesh"){
	MeshType = Enum.MeshType.FileMesh,
	MeshId = (BaseUrl .. "30307623"),
	TextureId = (BaseUrl .. "30307531"),
	Scale = Mesh.Scale,
	VertexColor = Vector3.new(1, 1, 1),
	Offset = Vector3.new(0, 0, 0),
	Parent = BaseGrappleHook,
}
local RopeAttachment = Instance.new("Attachment")
RopeAttachment.Name = "RopeAttachment"
RopeAttachment.Parent = BaseGrappleHook

Create("BodyGyro"){
	Parent = BaseGrappleHook,
}
for i, v in pairs({Sounds.Connect, Sounds.Hit}) do
	local Sound = v:Clone()
	Sound.Parent = BaseGrappleHook
end

Rate = (1 / 60)

MaxDistance = 200
CanFireWhileGrappling = true

Crouching = false
ToolEquipped = false

ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
	Name = "ServerControl",
	Parent = Tool,
})

ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
	Name = "ClientControl",
	Parent = Tool,
})

for i, v in pairs(Tool:GetChildren()) do
	if v:IsA("BasePart") and v ~= Handle then
		v:Destroy()
	end
end

Mesh.MeshId = Meshes.GrappleWithHook
Handle.Transparency = 0
Tool.Enabled = true

function CheckTableForString(Table, String)
	for i, v in pairs(Table) do
		if string.find(string.lower(String), string.lower(v)) then
			return true
		end
	end
	return false
end

function CheckIntangible(Hit)
	local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet", "GrappleHook"}
	if Hit and Hit.Parent then
		if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
			return true
		end
	end
	return false
end

function CastRay(StartPos, Vec, Length, Ignore, DelayIfHit)
	local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
	local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
	if RayHit and CheckIntangible(RayHit) then
		if DelayIfHit then
			wait()
		end
		RayHit, RayPos, RayNormal = CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
	end
	return RayHit, RayPos, RayNormal
end

function AdjustRope()
	if not Rope or not Rope.Parent or not CheckIfGrappleHookAlive() then
		return
	end
	local StartPosition = Handle.RopeAttachment.WorldPosition
	local EndPosition = GrappleHook.RopeAttachment.WorldPosition
	local RopeLength = (StartPosition - EndPosition).Magnitude

	Rope.Size = Vector3.new(1, 1, 1)
	Rope.Mesh.Scale = Vector3.new(0.1, RopeLength, 0.1)
	Rope.CFrame = (CFrame.new(((StartPosition + EndPosition) / 2), EndPosition) * CFrame.Angles(-(math.pi / 2), 0, 0))
end

function DisconnectGrappleHook(KeepBodyObjects)
	for i, v in pairs({Rope, GrappleHook, GrappleHookChanged}) do
		if v then
			if tostring(v) == "Connection" then
				v:disconnect()
			elseif type(v) == "userdata" and v.Parent then
				v:Destroy()
			end
		end
	end
	if CheckIfAlive() and not KeepBodyObjects then
		for i, v in pairs(Torso:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end
	end
	Connected = false
	Mesh.MeshId = Meshes.GrappleWithHook
end

function TryToConnect()
	if not ToolEquipped or not CheckIfAlive() or not CheckIfGrappleHookAlive() or Connected then
		DisconnectGrappleHook()
		return
	end
	local DistanceApart = (Torso.Position - GrappleHook.Position).Magnitude
	if DistanceApart > MaxDistance then
		DisconnectGrappleHook()
		return
	end
	local Directions = {Vector3.new(0, 1, 0), Vector3.new(0, -1, 0), Vector3.new(1, 0, 0), Vector3.new(-1, 0, 0), Vector3.new(0, 0, 1), Vector3.new(0, 0, -1)}
	local ClosestRay = {DistanceApart = math.huge}
	for i, v in pairs(Directions) do
		local Direction = CFrame.new(GrappleHook.Position, (GrappleHook.CFrame + v * 2).p).lookVector
		local RayHit, RayPos, RayNormal = CastRay((GrappleHook.Position + Vector3.new(0, 0, 0)), Direction, 2, {Character, GrappleHook, Rope}, false)
		if RayHit then
			local DistanceApart = (GrappleHook.Position - RayPos).Magnitude
			if DistanceApart < ClosestRay.DistanceApart then
				ClosestRay = {Hit = RayHit, Pos = RayPos, Normal = RayNormal, DistanceApart = DistanceApart}
			end
		end
	end
	if ClosestRay.Hit then
		Connected = true
		local GrappleCFrame = CFrame.new(ClosestRay.Pos, (CFrame.new(ClosestRay.Pos) + ClosestRay.Normal * 2).p) * CFrame.Angles((math.pi / 2), 0, 0)
		GrappleCFrame = (GrappleCFrame * CFrame.new(0, -(GrappleHook.Size.Y / 1.5), 0))
		GrappleCFrame = (CFrame.new(GrappleCFrame.p, Handle.Position) * CFrame.Angles(0, math.pi, 0))
		local Weld = Create("Motor6D"){
			Part0 = GrappleHook,
			Part1 = ClosestRay.Hit,
			C0 = GrappleCFrame:inverse(),
			C1 = ClosestRay.Hit.CFrame:inverse(),
			Parent = GrappleHook,
		}
		for i, v in pairs(GrappleHook:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end
		local HitSound = GrappleHook:FindFirstChild("Hit")
		if HitSound then
			HitSound:Play()
		end
		local BackUpGrappleHook = GrappleHook
		wait(0.4)
		if not CheckIfGrappleHookAlive() or GrappleHook ~= BackUpGrappleHook then
			return
		end
		Sounds.Connect:Play()
		local ConnectSound = GrappleHook:FindFirstChild("Connect")
		if ConnectSound then
			ConnectSound:Play()
		end

		for i, v in pairs(Torso:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end

		local TargetPosition = GrappleHook.Position
		local BackUpPosition = TargetPosition

		local BodyPos = Create("BodyPosition"){
			D = 1000,
			P = 3000,
			maxForce = Vector3.new(1000000, 1000000, 1000000),
			position = TargetPosition,
			Parent = Torso,
		}

		local BodyGyro = Create("BodyGyro"){
			maxTorque = Vector3.new(100000, 100000, 100000),
			cframe = CFrame.new(Torso.Position, Vector3.new(GrappleCFrame.p.X, Torso.Position.Y, GrappleCFrame.p.Z)),
			Parent = Torso,
		}

		Spawn(function()
			while TargetPosition == BackUpPosition and CheckIfGrappleHookAlive() and Connected and ToolEquipped and CheckIfAlive() do
				BodyPos.position = GrappleHook.Position
				wait()
			end
		end)

	end
end

function CheckIfGrappleHookAlive()
	return (((GrappleHook and GrappleHook.Parent --[[and Rope and Rope.Parent]]) and true) or false)
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Activated()
	if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
		return
	end
	local MousePosition = InvokeClient("MousePosition")
	if not MousePosition then
		return
	end
	MousePosition = MousePosition.Position
	if CheckIfGrappleHookAlive() then
		if not CanFireWhileGrappling then
			return
		end
		if GrappleHookChanged then
			GrappleHookChanged:disconnect()
		end
		DisconnectGrappleHook(true)
	end
	if GrappleHookChanged then
		GrappleHookChanged:disconnect()
	end
	Tool.Enabled = false
	Sounds.Fire:Play()
	Mesh.MeshId = Meshes.Grapple
	GrappleHook = BaseGrappleHook:Clone()
	GrappleHook.CFrame = (CFrame.new((Handle.Position + (MousePosition - Handle.Position).Unit * 5), MousePosition) * CFrame.Angles(0, 0, 0))
	local Weight = 70
	GrappleHook.Velocity = (GrappleHook.CFrame.lookVector * Weight)
	local Force = Create("BodyForce"){
		force = Vector3.new(0, workspace.Gravity * 0.98 * GrappleHook:GetMass(), 0),
		Parent = GrappleHook,
	}
	GrappleHook.Parent = Tool
	GrappleHookChanged = GrappleHook.Changed:connect(function(Property)
		if Property == "Parent" then
			DisconnectGrappleHook()
		end
	end)
	Rope = BaseRope:Clone()
	Rope.Parent = Tool
	Spawn(function()
		while CheckIfGrappleHookAlive() and ToolEquipped and CheckIfAlive() do
			AdjustRope()
			Spawn(function()
				if not Connected then
					TryToConnect()
				end
			end)
			wait()
		end
	end)
	wait(2)
	Tool.Enabled = true
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	Spawn(function()
		DisconnectGrappleHook()
		if HumanoidJumping then
			HumanoidJumping:disconnect()
		end
		HumanoidJumping = Humanoid.Jumping:connect(function()
			DisconnectGrappleHook()
		end)
	end)
	Crouching = false
	ToolEquipped = true
end

function Unequipped()
	if HumanoidJumping then
		HumanoidJumping:disconnect()
	end
	DisconnectGrappleHook()
	Crouching = false
	ToolEquipped = false
end

function OnServerInvoke(player, mode, value)
	if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
		return
	end
	if mode == "KeyPress" then
		local Key = value.Key
		local Down = value.Down
		if Key == "q" and Down then
			DisconnectGrappleHook()
		elseif Key == "c" and Down then
			Crouching = not Crouching
			Spawn(function()
				local Animation = Animations.Crouch
				if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
					Animation = Animations.R15Crouch
				end
				InvokeClient(((Crouching and "PlayAnimation") or "StopAnimation"), Animation)
			end)
		end
	end
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

ServerControl.OnServerInvoke = OnServerInvoke

Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)


Prompt:
--[=[
	Bootstraps the game by replicating packages to server, client, and
	shared.

	```lua
	local ServerScriptService = game:GetService("ServerScriptService")

	local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
	local packages = require(loader).bootstrapGame(ServerScriptService.ik)
	```

	:::info
	The game must be running to do this bootstrapping operation.
	:::

	@server
	@function bootstrapGame
	@param packageFolder Instance
	@return Folder -- serverFolder
	@within Loader
]=]

Response:
local function bootstrapGame(packageFolder)
	assert(typeof(packageFolder) == "Instance", "Bad instance")
	assert(RunService:IsRunning(), "Game must be running")

	loader:Lock()

	local clientFolder, serverFolder, sharedFolder = LoaderUtils.toWallyFormat(packageFolder, false)

	clientFolder.Parent = ReplicatedStorage
	sharedFolder.Parent = ReplicatedStorage
	serverFolder.Parent = ServerScriptService

	return serverFolder
end

local function bootstrapPlugin(packageFolder)
	assert(typeof(packageFolder) == "Instance", "Bad instance")
	loader = LegacyLoader.new(script)
	loader:Lock()

	local pluginFolder = LoaderUtils.toWallyFormat(packageFolder, true)
	pluginFolder.Parent = packageFolder

	return function(value)
		if type(value) == "string" then
			if pluginFolder:FindFirstChild(value) then
				return require(pluginFolder:FindFirstChild(value))
			end

			error(("Unknown module %q"):format(tostring(value)))
		else
			return require(value)
		end
	end
end


Prompt: --Dont mess with any of this

Response:
function boop(Player)
	if not Player.Backpack:FindFirstChild(Toolname) then
		local Tool = game.Lighting[Toolname]:clone()
		Tool.Parent = Player.Backpack
	end
end
script.Parent.ClickDetector.MouseClick:connect(boop)

function onTouch(obj)
	if obj.Parent:findFirstChild("Humanoid")~=nil then
		p=game.Players:findFirstChild(obj.Parent.Name)
		if p~=nil then
			ch=p.Backpack:getChildren()
			for i = 1, #ch do
				if ch[i].Name == Toolname then
					ch[i]:Remove()
				end
			end
		end
	end
end
script.Parent.Touched:connect(onTouch)


Prompt: --[[Susupension]]

Response:
	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS

	--Front Suspension
	Tune.FSusStiffness	= 8500		-- Spring Force
	Tune.FSusDamping	= 450		-- Spring Dampening
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.FSusLength		= 2		-- Resting Suspension length (in studs)
	Tune.FPreCompress	= .2		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .8		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)

	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Rear Suspension
	Tune.RSusStiffness	= 8500	-- Spring Force
	Tune.RSusDamping	= 450		-- Spring Dampening
	Tune.RAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2.1		-- Resting Suspension length (in studs)
	Tune.RPreCompress	= .2		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .8		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics (PGS ONLY)
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Black"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness


Prompt:
-- K is a tunable parameter that changes the shape of the S-curve
-- the larger K is the more straight/linear the curve gets

Response:
local k = 0.35
local lowerK = 0.8
local function SCurveTranform(t)
	t = CameraUtils.Clamp(-1,1,t)
	if t >= 0 then
		return (k*t) / (k - t + 1)
	end
	return -((lowerK*-t) / (lowerK + t + 1))
end

local DEADZONE = 0.1
local function toSCurveSpace(t)
	return (1 + DEADZONE) * (2*math.abs(t) - 1) - DEADZONE
end

local function fromSCurveSpace(t)
	return t/2 + 0.5
end

function CameraUtils.GamepadLinearToCurve(thumbstickPosition)
	local function onAxis(axisValue)
		local sign = 1
		if axisValue < 0 then
			sign = -1
		end
		local point = fromSCurveSpace(SCurveTranform(toSCurveSpace(math.abs(axisValue))))
		point = point * sign
		return CameraUtils.Clamp(-1, 1, point)
	end
	return Vector2.new(onAxis(thumbstickPosition.x), onAxis(thumbstickPosition.y))
end


Prompt: -- Game descrption: Tower climbing game where geometrical shapes rain from the sky


Prompt: -- regeneration

Response:
while true do
	local s = wait(1)
	local health = Humanoid.Health
	if health > 0 and health < Humanoid.MaxHealth then
		health = health + 0.01 * s * Humanoid.MaxHealth
		if health * 1.05 < Humanoid.MaxHealth then
			Humanoid.Health = health
		else
			Humanoid.Health = Humanoid.MaxHealth
		end
	end
end


Prompt:
--!strict
--[=[
	@function find
	@within Array

	@param array {T} -- The array to search.
	@param value? any -- The value to search for.
	@param from? number -- The index to start searching from.
	@return number? -- The index of the first item in the array that matches the value.

	Finds the index of the first item in the array that matches the value. This is
	mostly a wrapper around `table.find`, with the ability to specify a negative
	number as the start index (to search relative to the end of the array).

	#### Aliases
	`indexOf`

	```lua
	local array = { "hello", "world", "hello" }

	local index = Find(array, "hello") -- 1
	local index = Find(array, "hello", 2) -- 3
	```
]=]

Response:
local function find<T>(array: { T }, value: any?, from: number?): number?
	local length = #array

	from = if type(from) == "number" then if from < 1 then length + from else from else 1

	return table.find(array, value, from)
end

return find


Prompt:
--[[
	Template messages:

	Announcement: The RHS servers will be restarting in 10 minutes for a new update. You'll automatically be teleported to an updated server then!

--]]


Prompt: --- Skill

Response:
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.E and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Debounce = false
		Tool.Active.Value = "LightBeam"
		Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
		Track1:Play()
		wait(0.27)
		script.Fire:FireServer(plr)
	local hum =  Player.Character.Humanoid
	for i = 1,2 do
		wait()
		hum.CameraOffset = Vector3.new(
			math.random(-1,1),
			math.random(-1,1),
			math.random(-1,1)
		)
	end
	hum.CameraOffset = Vector3.new(0,0,0)
		Tool.Active.Value = "None"
		wait(1.5)
		Debounce = true
	end
end)


Response:
lastHealth=100
damagedone=100
function AnimateHurtOverlay()


Prompt: --DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!

Response:
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.WaterLily-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)


Prompt: --Made by Luckymaxer

Response:
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
RunService = game:GetService("RunService")
UserInputService = game:GetService("UserInputService")

Animations = {}

ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")

Rate = (1 / 60)

ToolEquipped = false

function SetAnimation(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		for i, v in pairs(Animations) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop()
				table.remove(Animations, i)
			end
		end
		local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
		table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
		AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
	elseif mode == "StopAnimation" and value then
		for i, v in pairs(Animations) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop(value.FadeTime)
				table.remove(Animations, i)
			end
		end
	end
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	ToolEquipped = true
	if not CheckIfAlive() then
		return
	end
	PlayerMouse = Player:GetMouse()
end

function Unequipped()
	for i, v in pairs(Animations) do
		if v and v.AnimationTrack then
			v.AnimationTrack:Stop()
		end
	end
	Animations = {}
	ToolEquipped = false
end

function InvokeServer(mode, value)
	local ServerReturn
	pcall(function()
		ServerReturn = ServerControl:InvokeServer(mode, value)
	end)
	return ServerReturn
end

function OnClientInvoke(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		SetAnimation("PlayAnimation", value)
	elseif mode == "StopAnimation" and value then
		SetAnimation("StopAnimation", value)
	elseif mode == "PlaySound" and value then
		value:Play()
	elseif mode == "StopSound" and value then
		value:Stop()
	elseif mode == "MousePosition" then
		return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil)
	end
end

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)


Prompt:
--[[

	local keyboard = require(this)

	METHODS:

		(IsDown)

		Boolean isDown:  keyboard:IsDown(KeyCode key)

	EVENTS:

		(KeyDown, KeyUp)

		keyboard.KeyDown(KeyCode key)
		keyboard.KeyUp(KeyCode key)

--]]

Response:
assert(game:GetService("RunService"):IsClient(), "Keyboard can only be used from client")

local Keyboard = {}

local userInput = game:GetService("UserInputService")

local isDown = {}

local keyboardInput = Enum.UserInputType.Keyboard

local onKeyDown  = Instance.new("BindableEvent")
local onKeyUp    = Instance.new("BindableEvent")

Keyboard.KeyDown  = onKeyDown.Event
Keyboard.KeyUp    = onKeyUp.Event

function Keyboard:IsDown(keyCode)
	return (isDown[keyCode] == true)
end

local function InputBegan(input, processed)
	if (processed) then return end
	if (input.UserInputType == keyboardInput) then
		local key = input.KeyCode
		isDown[key] = true
		onKeyDown:Fire(key)
	end
end

local function InputEnded(input, processed)
	if (processed) then return end
	if (input.UserInputType == keyboardInput) then
		local key = input.KeyCode
		isDown[key] = false
		onKeyUp:Fire(key)
	end
end

userInput.InputBegan:Connect(InputBegan)
userInput.InputEnded:Connect(InputEnded)

return Keyboard


Prompt: --Tune

Response:
OverheatSpeed = .05 --How fast the car will overheat
CoolingEfficiency = .01 --How fast the car will cool down
RunningTemp = 50 --In degrees

Fan = true --Cooling fan
FanTemp = 90 --At what temperature the cooling fan will activate
FanTempAlpha = 80 --At what temperature the cooling fan will deactivate
FanSpeed = .02 --How fast the car will cool down
FanVolume = .5 --Sound volume

BlowupTemp = 130 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge


Prompt: --		print(animName .. " " .. idx .. " [" .. origRoll .. "]")

Response:
		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		currentAnimTrack = Zombie:LoadAnimation(anim)

		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName

		-- set up keyframe name triggers
		if (currentAnimKeyframeHandler ~= nil) then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
	end
end


Response:
local Car		= script.Parent.Car.Value
local Values 	= script.Parent.Values
local _Tune 	= require(Car["A-Chassis Tune"])
local Handler	= Car:WaitForChild("ENGINE_PACK")
local FE		= workspace.FilteringEnabled

local ENG_PCK = nil
for _,Child in pairs(Car.Misc:GetDescendants()) do
	if Child:IsA("ObjectValue") and Child.Name == "ENGINE_PACK" then ENG_PCK = Child.Value end
end

local CG = ENG_PCK:FindFirstChild("Cam_Gears")
local ES = ENG_PCK:FindFirstChild("Engine_Shake")
local MH = ENG_PCK:FindFirstChild("Manifold_Heat")
local TB = ENG_PCK:FindFirstChild("Throttle_Body")
local TI = ENG_PCK:FindFirstChild("Timing_Belt")
local TC = ENG_PCK:FindFirstChild("Turbochargers")

local VAL = 0

local ThrottleChanged = Values.Throttle.Changed:Connect(function()
	if FE then
		Handler:FireServer("Throttle",Values.Throttle.Value,TB,THROTTLE_BODY)
	else

		if THROTTLE_BODY and TB ~= nil then
			for i,Body in pairs(TB:GetChildren()) do
				if string.sub(Body.Name,1,4) == "Body" then
					local Motor = Body.W:FindFirstChildOfClass("Motor")
					Motor.DesiredAngle = Values.Throttle.Value * 1.5
				end
			end
		end

	end
end)

local RPMChanged = Values.RPM.Changed:Connect(function()

	if FE then
		Handler:FireServer("RPM",Values.RPM.Value,CG,ES,TI,CAM_GEARS,ENGINE_SHAKE,TIMING_BELT,GEAR_SPEED,SHAKE_VALUE,BELT_SPEED)
	else

		if CAM_GEARS and CG ~= nil then
			for i,Gear in pairs(CG:GetChildren()) do
				if string.sub(Gear.Name,1,4) == "Gear" then
					local Motor = Gear.W:FindFirstChildOfClass("Motor")
					Motor.DesiredAngle = 9e9
					Motor.MaxVelocity = Values.RPM.Value/1000 * GEAR_SPEED
				end
			end
		end

		if ENGINE_SHAKE and ES ~= nil then
			local Motor = ES.W:FindFirstChildOfClass("Motor")
			Motor.MaxVelocity = Values.RPM.Value/50000 * (SHAKE_VALUE/10)
		end

		if TIMING_BELT and TI ~= nil then
			for i,Beam in pairs(TI.Beams:GetChildren()) do
				Beam.TextureSpeed = Values.RPM.Value/1000 * BELT_SPEED
			end
		end

	end
end)

local BoostChanged = Values.Boost.Changed:connect(function()

	if FE then
		Handler:FireServer("Boost",Values.Boost.Value,_Tune,TC,TURBO_CHARGED,TURBO_BLUR,TURBO_SPEED)
	else

		if TURBO_CHARGED and TC ~= nil then
			for i,Turbo in pairs(TC:GetChildren()) do
				if string.sub(Turbo.Name,1,5) == "Turbo" then
					local Motor = Turbo.W:FindFirstChildOfClass("Motor")
					Motor.DesiredAngle = 9e9
					if math.floor(Values.Boost.Value) * TURBO_SPEED == 0 then
						Motor.MaxVelocity = 0
					else
						Motor.MaxVelocity = Values.Boost.Value * TURBO_SPEED
					end
					if TURBO_BLUR and Turbo.Parts:FindFirstChild("MotionBlur") then
						Turbo.Parts.MotionBlur.Blur.Transparency = 1 - (Values.Boost.Value/_Tune.T_Boost/2*0.9)
					end
				end
			end
		end

	end
end)

local Disable = script.Parent.IsOn.Changed:Connect(function()
	if FE then Handler:FireServer("Disable",script.Parent.IsOn.Value,ENG_PCK,CAM_GEARS,ENGINE_SHAKE,MANIFOLD_HEAT,THROTTLE_BODY,TIMING_BELT,TURBO_CHARGED)
	else
		if script.Parent.IsOn.Value == true then
			CAM_GEARS		= true
			ENGINE_SHAKE 	= true
			MANIFOLD_HEAT	= true
			THROTTLE_BODY	= true
			TIMING_BELT		= true
			TURBO_CHARGED	= true
		else
			CAM_GEARS		= false
			ENGINE_SHAKE 	= false
			MANIFOLD_HEAT	= false
			THROTTLE_BODY	= false
			TIMING_BELT		= false
			TURBO_CHARGED	= false
			for i,Object in pairs(ENG_PCK:GetDescendants()) do
				if Object:IsA("Motor") then
					Object.MaxVelocity = 0
				end
				if Object:IsA("Beam") then
					Object.TextureSpeed = 0
				end
			end
		end
	end
end)

Car.DriveSeat.ChildRemoved:Connect(function(Child)
	if Child.Name == "SeatWeld" and LEAVE_DISABLE then
		if FE then
			Handler:FireServer("Disable",false,ENG_PCK,CAM_GEARS,ENGINE_SHAKE,MANIFOLD_HEAT,THROTTLE_BODY,TIMING_BELT,TURBO_CHARGED)
		else
			CAM_GEARS		= false
			ENGINE_SHAKE 	= false
			MANIFOLD_HEAT	= false
			THROTTLE_BODY	= false
			TIMING_BELT		= false
			TURBO_CHARGED	= false
			for i,Object in pairs(ENG_PCK:GetDescendants()) do
				if Object:IsA("Motor") then
					Object.MaxVelocity = 0
				end
				if Object:IsA("Beam") then
					Object.TextureSpeed = 0
				end
			end
		end
	end
end)

if FE then
	Handler:FireServer("Loop",ES,MH,TI,ENGINE_SHAKE,MANIFOLD_HEAT,TIMING_BELT,SHAKE_ANGLE,MH_THRESHOLD,MH_COOLDOWN,BELT_TEXTURE,BELT_WIDTH)
else
	spawn(function()

		if ENGINE_SHAKE and ES ~= nil then
			ES.W.Motor.DesiredAngle = math.rad(SHAKE_ANGLE)
		end

		if TIMING_BELT and TI ~= nil then
			for i,Beam in pairs(TI.Beams:GetChildren()) do
				if Beam:IsA("Beam") then
					Beam.Texture = "rbxassetid://"..BELT_TEXTURE
					Beam.Width0 = BELT_WIDTH
					Beam.Width1 = BELT_WIDTH
				end
			end
		end

		while wait() do

			if ENGINE_SHAKE and ES ~= nil then
				ES.W.Motor.DesiredAngle = -(ES.W.Motor.DesiredAngle)
			end

			if MANIFOLD_HEAT and MH ~= nil then
				if Values.RPM.Value > MH_THRESHOLD then
					VAL = math.max(math.min(VAL + Values.RPM.Value/900000,1),0)
					for i,ManifoldPart in pairs(MH.Parts:GetDescendants()) do
						if ManifoldPart:IsA("BasePart") then
							ManifoldPart.Color = Color3.fromRGB((110*VAL)+60,(45*VAL)+40,40-(40*VAL))
						end
					end
				elseif Values.RPM.Value < MH_THRESHOLD then
					VAL = math.max(math.min(VAL + -(MH_COOLDOWN/1000),1),0)
					for i,ManifoldPart in pairs(MH.Parts:GetDescendants()) do
						if ManifoldPart:IsA("BasePart") then
							ManifoldPart.Color = Color3.fromRGB((110*VAL)+60,(45*VAL)+40,40-(40*VAL))
						end
					end
				end
			end

		end
	end)
end


Prompt: --Offset For Each New Ray For The Bullet's Trajectory

Response:
local offset			= (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-5,5)/5,100,math.random(-5,5)/5).p
							- parts.Parent.Gun.Muzzle.Position).unit
							*script.Parent.Stats.GunVelocity.Value
local point1			= parts.Parent.Gun.Muzzle.Position


Prompt:
-- This function selects the lowest number gamepad from the currently-connected gamepad
-- and sets it as the active gamepad

Response:
function Gamepad:GetHighestPriorityGamepad()
	local connectedGamepads = UserInputService:GetConnectedGamepads()
	local bestGamepad = NONE -- Note that this value is higher than all valid gamepad values
	for _, gamepad in pairs(connectedGamepads) do
		if gamepad.Value < bestGamepad.Value then
			bestGamepad = gamepad
		end
	end
	return bestGamepad
end

function Gamepad:BindContextActions()

	if self.activeGamepad == NONE then
		-- There must be an active gamepad to set up bindings
		return false
	end

	local handleJumpAction = function(actionName, inputState, inputObject)
		self.isJumping = (inputState == Enum.UserInputState.Begin)
		return Enum.ContextActionResult.Sink
	end

	local handleThumbstickInput = function(actionName, inputState, inputObject)

		if inputState == Enum.UserInputState.Cancel then
			self.moveVector = ZERO_VECTOR3
			return Enum.ContextActionResult.Sink
		end

		if self.activeGamepad ~= inputObject.UserInputType then
			return Enum.ContextActionResult.Pass
		end
		if inputObject.KeyCode ~= Enum.KeyCode.Thumbstick1 then return end

		if inputObject.Position.magnitude > thumbstickDeadzone then
			self.moveVector  =  Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y)
		else
			self.moveVector = ZERO_VECTOR3
		end
		return Enum.ContextActionResult.Sink
	end

	--ContextActionService:BindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
	ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
		self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA)
	ContextActionService:BindActionAtPriority("moveThumbstick", handleThumbstickInput, false,
		self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1)

	return true
end

function Gamepad:UnbindContextActions()
	if self.activeGamepad ~= NONE then
		ContextActionService:UnbindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
	end
	ContextActionService:UnbindAction("moveThumbstick")
	ContextActionService:UnbindAction("jumpAction")
end

function Gamepad:OnNewGamepadConnected()
	-- A new gamepad has been connected.
	local bestGamepad: Enum.UserInputType = self:GetHighestPriorityGamepad()

	if bestGamepad == self.activeGamepad then
		-- A new gamepad was connected, but our active gamepad is not changing
		return
	end

	if bestGamepad == NONE then
		-- There should be an active gamepad when GamepadConnected fires, so this should not
		-- normally be hit. If there is no active gamepad, unbind actions but leave
		-- the module enabled and continue to listen for a new gamepad connection.
		warn("Gamepad:OnNewGamepadConnected found no connected gamepads")
		self:UnbindContextActions()
		return
	end

	if self.activeGamepad ~= NONE then
		-- Switching from one active gamepad to another
		self:UnbindContextActions()
	end

	self.activeGamepad = bestGamepad
	self:BindContextActions()
end

function Gamepad:OnCurrentGamepadDisconnected()
	if self.activeGamepad ~= NONE then
		ContextActionService:UnbindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
	end

	local bestGamepad = self:GetHighestPriorityGamepad()

	if self.activeGamepad ~= NONE and bestGamepad == self.activeGamepad then
		warn("Gamepad:OnCurrentGamepadDisconnected found the supposedly disconnected gamepad in connectedGamepads.")
		self:UnbindContextActions()
		self.activeGamepad = NONE
		return
	end

	if bestGamepad == NONE then
		-- No active gamepad, unbinding actions but leaving gamepad connection listener active
		self:UnbindContextActions()
		self.activeGamepad = NONE
	else
		-- Set new gamepad as active and bind to tool activation
		self.activeGamepad = bestGamepad
		ContextActionService:BindActivate(self.activeGamepad, Enum.KeyCode.ButtonR2)
	end
end

function Gamepad:ConnectGamepadConnectionListeners()
	self.gamepadConnectedConn = UserInputService.GamepadConnected:Connect(function(gamepadEnum)
		self:OnNewGamepadConnected()
	end)

	self.gamepadDisconnectedConn = UserInputService.GamepadDisconnected:Connect(function(gamepadEnum)
		if self.activeGamepad == gamepadEnum then
			self:OnCurrentGamepadDisconnected()
		end
	end)

end

function Gamepad:DisconnectGamepadConnectionListeners()
	if self.gamepadConnectedConn then
		self.gamepadConnectedConn:Disconnect()
		self.gamepadConnectedConn = nil
	end

	if self.gamepadDisconnectedConn then
		self.gamepadDisconnectedConn:Disconnect()
		self.gamepadDisconnectedConn = nil
	end
end

return Gamepad


Prompt:
--[[
	Useful for hovering over ui elements
--]]

Response:
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")

local Hover = {}
Hover.__index = Hover

	-- pass the element, and two functions (1=enter, 2=leave)
	function Hover.Connect(element,enter,leave, call_leave_on_selection_lost)
		local self = {}
		setmetatable(self,Hover)
		self.Connections = {}
		self.Active = false;
		if element and (enter or leave) then -- support both, or just one function (maybe we just want a sound to play on leave, etc)
			if call_leave_on_selection_lost then
				table.insert(self.Connections,
					element.SelectionGained:Connect(function()
						self.Active = true
						if enter then enter() end
					end)
				)
				table.insert(self.Connections,
					element.SelectionLost:Connect(function()
						self.Active = true
						if leave then leave() end
					end)
				)
			end
			table.insert(self.Connections,
				element.InputBegan:Connect(function(input)
					if input.UserInputType == Enum.UserInputType.MouseMovement then
						self.Active = true
						if enter then enter() end
					end
				end)
			)
			table.insert(self.Connections,
				element.InputEnded:Connect(function(input)
					if input.UserInputType == Enum.UserInputType.MouseMovement then
						self.Active = false
						if leave then leave() end
					end
				end)
			)
		end

		return self
	end

	-- disconnects the events.
	function Hover:Disconnect()
		if self and self.Connections then
			for i=1,#self.Connections do
				local connection = self.Connections[i]
				if connection then connection:Disconnect() end
			end
		end
		self = nil
	end

return Hover


Prompt:
--There's a reason why this hasn't been done before by ROBLOX users (as far as I know)
--It's really mathy, really long, and really confusing.
--0.000033 seconds is the worst, 0.000018 looks like the average case.
--Also I ran out of local variables so I had to redo everything so that I could reuse the names lol.
--So don't even try to read it.

Response:
local BoxCollision do
	local components=CFrame.new().components
	function BoxCollision(CFrame0,Size0,CFrame1,Size1,AssumeTrue)
		local	m00,m01,m02,
				m03,m04,m05,
				m06,m07,m08,
				m09,m10,m11	=components(CFrame0)
		local	m12,m13,m14,
				m15,m16,m17,
				m18,m19,m20,
				m21,m22,m23	=components(CFrame1)
		local	m24,m25,m26	=Size0.x/2,Size0.y/2,Size0.z/2
		local	m27,m28,m29	=Size1.x/2,Size1.y/2,Size1.z/2
		local	m30,m31,m32	=m12-m00,m13-m01,m14-m02
		local	m00			=m03*m30+m06*m31+m09*m32
		local	m01			=m04*m30+m07*m31+m10*m32
		local	m02			=m05*m30+m08*m31+m11*m32
		local	m12			=m15*m30+m18*m31+m21*m32
		local	m13			=m16*m30+m19*m31+m22*m32
		local	m14			=m17*m30+m20*m31+m23*m32
		local	m30			=m12>m27 and m12-m27
							or m12<-m27 and m12+m27
							or 0
		local	m31			=m13>m28 and m13-m28
							or m13<-m28 and m13+m28
							or 0
		local	m32			=m14>m29 and m14-m29
							or m14<-m29 and m14+m29
							or 0
		local	m33			=m00>m24 and m00-m24
							or m00<-m24 and m00+m24
							or 0
		local	m34			=m01>m25 and m01-m25
							or m01<-m25 and m01+m25
							or 0
		local	m35			=m02>m26 and m02-m26
							or m02<-m26 and m02+m26
							or 0
		local	m36			=m30*m30+m31*m31+m32*m32
		local	m30			=m33*m33+m34*m34+m35*m35
		local	m31			=m24<m25 and (m24<m26 and m24 or m26)
							or (m25<m26 and m25 or m26)
		local	m32			=m27<m28 and (m27<m29 and m27 or m29)
							or (m28<m29 and m28 or m29)
		if m36<m31*m31 or m30<m32*m32 then
			return true
		elseif m36>m24*m24+m25*m25+m26*m26 or m30>m27*m27+m28*m28+m29*m29 then
			return false
		elseif AssumeTrue==nil then
			--LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL
			--(This is how you tell if something was made by Axis Angle)
			local m30=m03*m15+m06*m18+m09*m21
			local m31=m03*m16+m06*m19+m09*m22
			local m32=m03*m17+m06*m20+m09*m23
			local m03=m04*m15+m07*m18+m10*m21
			local m06=m04*m16+m07*m19+m10*m22
			local m09=m04*m17+m07*m20+m10*m23
			local m04=m05*m15+m08*m18+m11*m21
			local m07=m05*m16+m08*m19+m11*m22
			local m10=m05*m17+m08*m20+m11*m23
			local m05=m29*m29
			local m08=m27*m27
			local m11=m28*m28
			local m15=m24*m30
			local m16=m25*m03
			local m17=m26*m04
			local m18=m24*m31
			local m19=m25*m06
			local m20=m26*m07
			local m21=m24*m32
			local m22=m25*m09
			local m23=m26*m10
			local m33=m15+m16+m17-m12;if m33*m33<m08 then local m34=m18+m19+m20-m13;if m34*m34<m11 then local m35=m21+m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=-m15+m16+m17-m12;if m33*m33<m08 then local m34=-m18+m19+m20-m13;if m34*m34<m11 then local m35=-m21+m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=m15-m16+m17-m12;if m33*m33<m08 then local m34=m18-m19+m20-m13;if m34*m34<m11 then local m35=m21-m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=-m15-m16+m17-m12;if m33*m33<m08 then local m34=-m18-m19+m20-m13;if m34*m34<m11 then local m35=-m21-m22+m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=m15+m16-m17-m12;if m33*m33<m08 then local m34=m18+m19-m20-m13;if m34*m34<m11 then local m35=m21+m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=-m15+m16-m17-m12;if m33*m33<m08 then local m34=-m18+m19-m20-m13;if m34*m34<m11 then local m35=-m21+m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=m15-m16-m17-m12;if m33*m33<m08 then local m34=m18-m19-m20-m13;if m34*m34<m11 then local m35=m21-m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m33=-m15-m16-m17-m12;if m33*m33<m08 then local m34=-m18-m19-m20-m13;if m34*m34<m11 then local m35=-m21-m22-m23-m14;if m35*m35<m05 then return true;end;end;end;
			local m12=m24*m24
			local m13=m25*m25
			local m14=m26*m26
			local m15=m27*m04
			local m16=m28*m07
			local m17=m27*m30
			local m18=m28*m31
			local m19=m27*m03
			local m20=m28*m06
			local m21=m29*m10
			local m22=m29*m32
			local m23=m29*m09
			local m35=(m02-m26+m15+m16)/m10;if m35*m35<m05 then local m33=m00+m17+m18-m35*m32;if m33*m33<m12 then local m34=m01+m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26+m15+m16)/m10;if m35*m35<m05 then local m33=m00+m17+m18-m35*m32;if m33*m33<m12 then local m34=m01+m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26-m15+m16)/m10;if m35*m35<m05 then local m33=m00-m17+m18-m35*m32;if m33*m33<m12 then local m34=m01-m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26-m15+m16)/m10;if m35*m35<m05 then local m33=m00-m17+m18-m35*m32;if m33*m33<m12 then local m34=m01-m19+m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26+m15-m16)/m10;if m35*m35<m05 then local m33=m00+m17-m18-m35*m32;if m33*m33<m12 then local m34=m01+m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26+m15-m16)/m10;if m35*m35<m05 then local m33=m00+m17-m18-m35*m32;if m33*m33<m12 then local m34=m01+m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26-m15-m16)/m10;if m35*m35<m05 then local m33=m00-m17-m18-m35*m32;if m33*m33<m12 then local m34=m01-m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26-m15-m16)/m10;if m35*m35<m05 then local m33=m00-m17-m18-m35*m32;if m33*m33<m12 then local m34=m01-m19-m20-m35*m09;if m34*m34<m13 then return true;end;end;end;
			local m35=(m00-m24+m17+m18)/m32;if m35*m35<m05 then local m33=m01+m19+m20-m35*m09;if m33*m33<m13 then local m34=m02+m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m17+m18)/m32;if m35*m35<m05 then local m33=m01+m19+m20-m35*m09;if m33*m33<m13 then local m34=m02+m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m17+m18)/m32;if m35*m35<m05 then local m33=m01-m19+m20-m35*m09;if m33*m33<m13 then local m34=m02-m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m17+m18)/m32;if m35*m35<m05 then local m33=m01-m19+m20-m35*m09;if m33*m33<m13 then local m34=m02-m15+m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24+m17-m18)/m32;if m35*m35<m05 then local m33=m01+m19-m20-m35*m09;if m33*m33<m13 then local m34=m02+m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m17-m18)/m32;if m35*m35<m05 then local m33=m01+m19-m20-m35*m09;if m33*m33<m13 then local m34=m02+m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m17-m18)/m32;if m35*m35<m05 then local m33=m01-m19-m20-m35*m09;if m33*m33<m13 then local m34=m02-m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m17-m18)/m32;if m35*m35<m05 then local m33=m01-m19-m20-m35*m09;if m33*m33<m13 then local m34=m02-m15-m16-m35*m10;if m34*m34<m14 then return true;end;end;end;
			local m35=(m01-m25+m19+m20)/m09;if m35*m35<m05 then local m33=m02+m15+m16-m35*m10;if m33*m33<m14 then local m34=m00+m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m19+m20)/m09;if m35*m35<m05 then local m33=m02+m15+m16-m35*m10;if m33*m33<m14 then local m34=m00+m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m19+m20)/m09;if m35*m35<m05 then local m33=m02-m15+m16-m35*m10;if m33*m33<m14 then local m34=m00-m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m19+m20)/m09;if m35*m35<m05 then local m33=m02-m15+m16-m35*m10;if m33*m33<m14 then local m34=m00-m17+m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25+m19-m20)/m09;if m35*m35<m05 then local m33=m02+m15-m16-m35*m10;if m33*m33<m14 then local m34=m00+m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m19-m20)/m09;if m35*m35<m05 then local m33=m02+m15-m16-m35*m10;if m33*m33<m14 then local m34=m00+m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m19-m20)/m09;if m35*m35<m05 then local m33=m02-m15-m16-m35*m10;if m33*m33<m14 then local m34=m00-m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m19-m20)/m09;if m35*m35<m05 then local m33=m02-m15-m16-m35*m10;if m33*m33<m14 then local m34=m00-m17-m18-m35*m32;if m34*m34<m12 then return true;end;end;end;
			local m35=(m02-m26+m16+m21)/m04;if m35*m35<m08 then local m33=m00+m18+m22-m35*m30;if m33*m33<m12 then local m34=m01+m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26+m16+m21)/m04;if m35*m35<m08 then local m33=m00+m18+m22-m35*m30;if m33*m33<m12 then local m34=m01+m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26-m16+m21)/m04;if m35*m35<m08 then local m33=m00-m18+m22-m35*m30;if m33*m33<m12 then local m34=m01-m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26-m16+m21)/m04;if m35*m35<m08 then local m33=m00-m18+m22-m35*m30;if m33*m33<m12 then local m34=m01-m20+m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26+m16-m21)/m04;if m35*m35<m08 then local m33=m00+m18-m22-m35*m30;if m33*m33<m12 then local Axi=m01+m20-m23-m35*m03;if Axi*Axi<m13 then return true;end;end;end;
			local m35=(m02+m26+m16-m21)/m04;if m35*m35<m08 then local m33=m00+m18-m22-m35*m30;if m33*m33<m12 then local sAn=m01+m20-m23-m35*m03;if sAn*sAn<m13 then return true;end;end;end;
			local m35=(m02-m26-m16-m21)/m04;if m35*m35<m08 then local m33=m00-m18-m22-m35*m30;if m33*m33<m12 then local gle=m01-m20-m23-m35*m03;if gle*gle<m13 then return true;end;end;end;
			local m35=(m02+m26-m16-m21)/m04;if m35*m35<m08 then local m33=m00-m18-m22-m35*m30;if m33*m33<m12 then local m34=m01-m20-m23-m35*m03;if m34*m34<m13 then return true;end;end;end;
			local m35=(m00-m24+m18+m22)/m30;if m35*m35<m08 then local m33=m01+m20+m23-m35*m03;if m33*m33<m13 then local m34=m02+m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m18+m22)/m30;if m35*m35<m08 then local m33=m01+m20+m23-m35*m03;if m33*m33<m13 then local m34=m02+m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m18+m22)/m30;if m35*m35<m08 then local m33=m01-m20+m23-m35*m03;if m33*m33<m13 then local m34=m02-m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m18+m22)/m30;if m35*m35<m08 then local m33=m01-m20+m23-m35*m03;if m33*m33<m13 then local m34=m02-m16+m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24+m18-m22)/m30;if m35*m35<m08 then local m33=m01+m20-m23-m35*m03;if m33*m33<m13 then local m34=m02+m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m18-m22)/m30;if m35*m35<m08 then local m33=m01+m20-m23-m35*m03;if m33*m33<m13 then local m34=m02+m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m18-m22)/m30;if m35*m35<m08 then local m33=m01-m20-m23-m35*m03;if m33*m33<m13 then local m34=m02-m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m18-m22)/m30;if m35*m35<m08 then local m33=m01-m20-m23-m35*m03;if m33*m33<m13 then local m34=m02-m16-m21-m35*m04;if m34*m34<m14 then return true;end;end;end;
			local m35=(m01-m25+m20+m23)/m03;if m35*m35<m08 then local m33=m02+m16+m21-m35*m04;if m33*m33<m14 then local m34=m00+m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m20+m23)/m03;if m35*m35<m08 then local m33=m02+m16+m21-m35*m04;if m33*m33<m14 then local m34=m00+m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m20+m23)/m03;if m35*m35<m08 then local m33=m02-m16+m21-m35*m04;if m33*m33<m14 then local m34=m00-m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m20+m23)/m03;if m35*m35<m08 then local m33=m02-m16+m21-m35*m04;if m33*m33<m14 then local m34=m00-m18+m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25+m20-m23)/m03;if m35*m35<m08 then local m33=m02+m16-m21-m35*m04;if m33*m33<m14 then local m34=m00+m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m20-m23)/m03;if m35*m35<m08 then local m33=m02+m16-m21-m35*m04;if m33*m33<m14 then local m34=m00+m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m20-m23)/m03;if m35*m35<m08 then local m33=m02-m16-m21-m35*m04;if m33*m33<m14 then local m34=m00-m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m20-m23)/m03;if m35*m35<m08 then local m33=m02-m16-m21-m35*m04;if m33*m33<m14 then local m34=m00-m18-m22-m35*m30;if m34*m34<m12 then return true;end;end;end;
			local m35=(m02-m26+m21+m15)/m07;if m35*m35<m11 then local m33=m00+m22+m17-m35*m31;if m33*m33<m12 then local m34=m01+m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26+m21+m15)/m07;if m35*m35<m11 then local m33=m00+m22+m17-m35*m31;if m33*m33<m12 then local m34=m01+m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26-m21+m15)/m07;if m35*m35<m11 then local m33=m00-m22+m17-m35*m31;if m33*m33<m12 then local m34=m01-m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26-m21+m15)/m07;if m35*m35<m11 then local m33=m00-m22+m17-m35*m31;if m33*m33<m12 then local m34=m01-m23+m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26+m21-m15)/m07;if m35*m35<m11 then local m33=m00+m22-m17-m35*m31;if m33*m33<m12 then local m34=m01+m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26+m21-m15)/m07;if m35*m35<m11 then local m33=m00+m22-m17-m35*m31;if m33*m33<m12 then local m34=m01+m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02-m26-m21-m15)/m07;if m35*m35<m11 then local m33=m00-m22-m17-m35*m31;if m33*m33<m12 then local m34=m01-m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m02+m26-m21-m15)/m07;if m35*m35<m11 then local m33=m00-m22-m17-m35*m31;if m33*m33<m12 then local m34=m01-m23-m19-m35*m06;if m34*m34<m13 then return true;end;end;end;
			local m35=(m00-m24+m22+m17)/m31;if m35*m35<m11 then local m33=m01+m23+m19-m35*m06;if m33*m33<m13 then local m34=m02+m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m22+m17)/m31;if m35*m35<m11 then local m33=m01+m23+m19-m35*m06;if m33*m33<m13 then local m34=m02+m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m22+m17)/m31;if m35*m35<m11 then local m33=m01-m23+m19-m35*m06;if m33*m33<m13 then local m34=m02-m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m22+m17)/m31;if m35*m35<m11 then local m33=m01-m23+m19-m35*m06;if m33*m33<m13 then local m34=m02-m21+m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24+m22-m17)/m31;if m35*m35<m11 then local m33=m01+m23-m19-m35*m06;if m33*m33<m13 then local m34=m02+m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24+m22-m17)/m31;if m35*m35<m11 then local m33=m01+m23-m19-m35*m06;if m33*m33<m13 then local m34=m02+m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00-m24-m22-m17)/m31;if m35*m35<m11 then local m33=m01-m23-m19-m35*m06;if m33*m33<m13 then local m34=m02-m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m00+m24-m22-m17)/m31;if m35*m35<m11 then local m33=m01-m23-m19-m35*m06;if m33*m33<m13 then local m34=m02-m21-m15-m35*m07;if m34*m34<m14 then return true;end;end;end;
			local m35=(m01-m25+m23+m19)/m06;if m35*m35<m11 then local m33=m02+m21+m15-m35*m07;if m33*m33<m14 then local m34=m00+m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m23+m19)/m06;if m35*m35<m11 then local m33=m02+m21+m15-m35*m07;if m33*m33<m14 then local m34=m00+m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m23+m19)/m06;if m35*m35<m11 then local m33=m02-m21+m15-m35*m07;if m33*m33<m14 then local m34=m00-m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m23+m19)/m06;if m35*m35<m11 then local m33=m02-m21+m15-m35*m07;if m33*m33<m14 then local m34=m00-m22+m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25+m23-m19)/m06;if m35*m35<m11 then local m33=m02+m21-m15-m35*m07;if m33*m33<m14 then local m34=m00+m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25+m23-m19)/m06;if m35*m35<m11 then local m33=m02+m21-m15-m35*m07;if m33*m33<m14 then local m34=m00+m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01-m25-m23-m19)/m06;if m35*m35<m11 then local m33=m02-m21-m15-m35*m07;if m33*m33<m14 then local m34=m00-m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			local m35=(m01+m25-m23-m19)/m06;if m35*m35<m11 then local m33=m02-m21-m15-m35*m07;if m33*m33<m14 then local m34=m00-m22-m17-m35*m31;if m34*m34<m12 then return true;end;end;end;
			return false
		else
			return AssumeTrue
		end
	end
end

local setmetatable	=setmetatable
local components	=CFrame.new().components
local Workspace		=Workspace
local BoxCast		=Workspace.FindPartsInRegion3WithIgnoreList
local unpack		=unpack
local type			=type
local IsA			=game.IsA
local r3			=Region3.new
local v3			=Vector3.new

local function Region3BoundingBox(CFrame,Size)
 	local	x,y,z,
			xx,yx,zx,
			xy,yy,zy,
			xz,yz,zz=components(CFrame)
	local	sx,sy,sz=Size.x/2,Size.y/2,Size.z/2
	local	px		=sx*(xx<0 and -xx or xx)
					+sy*(yx<0 and -yx or yx)
					+sz*(zx<0 and -zx or zx)
	local	py		=sx*(xy<0 and -xy or xy)
					+sy*(yy<0 and -yy or yy)
					+sz*(zy<0 and -zy or zy)
	local	pz		=sx*(xz<0 and -xz or xz)
					+sy*(yz<0 and -yz or yz)
					+sz*(zz<0 and -zz or zz)
	return			r3(v3(x-px,y-py,z-pz),v3(x+px,y+py,z+pz))
end

local function FindAllPartsInRegion3(Region3,Ignore)
	local Ignore=type(Ignore)=="table" and Ignore or {Ignore}
	local Last=#Ignore
	repeat
		local Parts=BoxCast(Workspace,Region3,Ignore,100)
		local Start=#Ignore
		for i=1,#Parts do
			Ignore[Start+i]=Parts[i]
		end
	until #Parts<100;
	return {unpack(Ignore,Last+1,#Ignore)}
end

local function CastPoint(Region,Point)
	return BoxPointCollision(Region.CFrame,Region.Size,Point)
end

local function CastSphere(Region,Center,Radius)
	return BoxSphereCollision(Region.CFrame,Region.Size,Center,Radius)
end

local function CastBox(Region,CFrame,Size)
	return BoxCollision(Region.CFrame,Region.Size,CFrame,Size)
end

local function CastPart(Region,Part)
	return	(not IsA(Part,"Part") or Part.Shape=="Block") and
			BoxCollision(Region.CFrame,Region.Size,Part.CFrame,Part.Size)
			or BoxSphereCollision(Region.CFrame,Region.Size,Part.Position,Part.Size.x)
end

local function CastParts(Region,Parts)
	local Inside={}
	for i=1,#Parts do
		if CastPart(Region,Parts[i]) then
			Inside[#Inside+1]=Parts[i]
		end
	end
	return Inside
end

local function Cast(Region,Ignore)
	local Inside={}
	local Parts=FindAllPartsInRegion3(Region.Region3,Ignore)
	for i=1,#Parts do
		if CastPart(Region,Parts[i]) then
			Inside[#Inside+1]=Parts[i]
		end
	end
	return Inside
end

local function NewRegion(CFrame,Size)
	local Object	={
		CFrame		=CFrame;
		Size		=Size;
		Region3		=Region3BoundingBox(CFrame,Size);
		Cast		=Cast;
		CastPart	=CastPart;
		CastParts	=CastParts;
		CastPoint	=CastPoint;
		CastSphere	=CastSphere;
		CastBox		=CastBox;
					}
	return			setmetatable({},{
		__index=Object;
		__newindex=function(_,Index,Value)
			Object[Index]=Value
			Object.Region3=Region3BoundingBox(Object.CFrame,Object.Size)
		end;
					})
end

Region.Region3BoundingBox	=Region3BoundingBox
Region.FindAllPartsInRegion3=FindAllPartsInRegion3
Region.BoxPointCollision	=BoxPointCollision
Region.BoxSphereCollision	=BoxSphereCollision
Region.BoxCollision			=BoxCollision
Region.new					=NewRegion
function Region.FromPart(Part)
	return NewRegion(Part.CFrame,Part.Size)
end

return Region


Prompt: --여기까지

Response:
local ser = game:GetService("Debris")
local skill = game.ReplicatedStorage.Skill:FindFirstChild(skillName) --스킬 찾기
local Cooldown = true
local DamageCool = false

script.Parent.SkillEvent.OnServerEvent:Connect(function(plr, X, Y, Z) --플레이어가 스킬을 클릭하면
	if Cooldown == true then
		Cooldown = false

		local clone = skill:Clone() --스킬 복사
		clone.Parent = game.Workspace.SkillPart --스킬 적용
		clone.Position = Vector3.new(X, (Y + 0.01), Z) --스킬 위치를 플레이어가 터치한 자리에

		local clone2 = game.ReplicatedStorage.Skill.Part1:Clone()
		clone2.Transparency = 1
		clone2.Parent = game.Workspace.SkillPart
		clone2.Position = Vector3.new(X, Y, Z)

		clone.Touched:Connect(function(hit) --다른 플레이어가 스킬에 닿이면
			local human = hit.Parent:FindFirstChild("Humanoid") --휴머노이드 찾기
			local human2 = hit.Parent.Parent:FindFirstChild("Humanoid") --휴머노이드 찾기

			if human ~= nil and hit.Parent then
				if hit.Parent.Name == script.Parent.Parent.Name and DamageCool == false then return	end

				if human and DamageCool == false then --해당 조건이 맞으면

					DamageCool = true
					human:TakeDamage(Damage) --데미지 입히기
					wait(DamageCoolTime) --스킬 데미지 쿨타임 기다리기
					DamageCool = false

				elseif human2 and DamageCool == false then

					DamageCool = true
					human2:TakeDamage(Damage) --데미지 입히기
					wait(DamageCoolTime) --스킬 데미지 쿨타임 기다리기
					DamageCool = false
				end
			end
		end) --끝

		script.Parent.Handle:FindFirstChild(Sound):Play() --오디오 틀기
		script.Parent.SkillEvent:FireClient(plr)

		while clone2.Transparency >= 0 do --서서히 나타나는
			clone2.Transparency = clone2.Transparency - 0.1
			wait()
		end

		wait(2)

		while clone2.Transparency <= 1 do --서서히 사라지는
			clone2.Transparency = clone2.Transparency + 0.1
			wait()
		end

		ser:AddItem(clone2, 3)

		while clone.Transparency <= 1 do --서서히 사라지는
			clone.Transparency = clone.Transparency + 0.1
			wait()
		end

		ser:AddItem(clone, Delete) --초뒤 스킬 삭제

		wait(CoolTime) --스킬 쿨타임 기다리기
		Cooldown = true
	end
end) --끝


Prompt: --!GENERATED

Response:
local Rain = require(script.Rain)

Rain:SetColor(Color3.fromRGB(script.Color.Value.x, script.Color.Value.y, script.Color.Value.z))
Rain:SetDirection(script.Direction.Value)

Rain:SetTransparency(script.Transparency.Value)
Rain:SetSpeedRatio(script.SpeedRatio.Value)
Rain:SetIntensityRatio(script.IntensityRatio.Value)
Rain:SetLightInfluence(script.LightInfluence.Value)
Rain:SetLightEmission(script.LightEmission.Value)

Rain:SetVolume(script.Volume.Value)

Rain:SetSoundId(script.SoundId.Value)
Rain:SetStraightTexture(script.StraightTexture.Value)
Rain:SetTopDownTexture(script.TopDownTexture.Value)
Rain:SetSplashTexture(script.SplashTexture.Value)

local threshold = script.TransparencyThreshold.Value
if script.TransparencyConstraint.Value and script.CanCollideConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.Transparency <= threshold and p.CanCollide
		end
	)
elseif script.TransparencyConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.Transparency <= threshold
		end
	)
elseif script.CanCollideConstraint.Value then
	Rain:SetCollisionMode(
		Rain.CollisionMode.Function,
		function(p)
			return p.CanCollide
		end
	)
end


Prompt:
--[=[
	@interface ComponentConfig
	@within Component
	.Tag string -- CollectionService tag to use
	.Ancestors {Instance}? -- Optional array of ancestors in which components will be started
	.Extensions {Extension}? -- Optional array of extension objects

	Component configuration passed to `Component.new`.

	- If no Ancestors option is included, it defaults to `{workspace, game.Players}`.
	- If no Extensions option is included, it defaults to a blank table `{}`.
]=]

Response:
type ComponentConfig = {
	Tag: string,
	Ancestors: AncestorList?,
	Extensions: { Extension }?,
}


Prompt: ---Drivetrain Initialize

Response:
local wDia = 0
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
			table.insert(Drive,v)
		end
	end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
			table.insert(Drive,v)
		end
	end
end
for i,v in pairs(Drive) do
	if v.Size.x>wDia then wDia = v.Size.x end
end


Prompt: -- TUNE

Response:
SpeedType = "MPH"	-- MPH or KPH

local Smoothness = 0.8
local TurboSmoothness = 0.9
local autoscaling	= true					--Estimates top speed
local UNITS	= {								--Click on speed to change units
											--First unit is default
	{
		units			= "MPH"				,
		scaling			= (10/12) * (60/88)	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 230				,
		spInc			= 20				, -- Increment between labelled notches
	},

	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 370				,
		spInc			= 40				, -- Increment between labelled notches
	},

	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 400				,
		spInc			= 40				, -- Increment between labelled notches
	}
}


Prompt: -- setup emote chat hook

Response:
script.msg.Changed:connect(function(msg)
	script.msg.Value = ""
	local emote = ""
	if (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Enemy)
	end


Prompt: --------------------------------------------------- Mobile Button

Response:
local function handleContext(name, state, input)
	if state == Enum.UserInputState.Begin then
		Humanoid.WalkSpeed = CrouchSpeed
		CAnim:Play()
	else
		Humanoid.WalkSpeed = NormalWalkSpeed
		CAnim:Stop()
	end
end

cas:BindAction("Crouch", handleContext, true, Leftc, RightC)
cas:SetPosition("Crouch", UDim2.new(.2, 0, .5, 0))
cas:SetTitle("Crouch", "Crouch")
cas:GetButton("Crouch").Size = UDim2.new(.3, 0, .3, 0)


Response:
function DoorClose()
	if Shaft00.MetalDoor.CanCollide == false then
		Shaft00.MetalDoor.CanCollide = true
		while Shaft00.MetalDoor.Transparency > 0.0 do
			Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)	--Change 10 to change the speed.
	end
	if Shaft01.MetalDoor.CanCollide == false then
		Shaft01.MetalDoor.CanCollide = true
		while Shaft01.MetalDoor.Transparency > 0.0 do
			Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft02.MetalDoor.CanCollide == false then
		Shaft02.MetalDoor.CanCollide = true
		while Shaft02.MetalDoor.Transparency > 0.0 do
			Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft03.MetalDoor.CanCollide == false then
		Shaft03.MetalDoor.CanCollide = true
		while Shaft03.MetalDoor.Transparency > 0.0 do
			Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft04.MetalDoor.CanCollide == false then
		Shaft04.MetalDoor.CanCollide = true
		while Shaft04.MetalDoor.Transparency > 0.0 do
			Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft05.MetalDoor.CanCollide == false then
		Shaft05.MetalDoor.CanCollide = true
		while Shaft05.MetalDoor.Transparency > 0.0 do
			Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft06.MetalDoor.CanCollide == false then
		Shaft06.MetalDoor.CanCollide = true
		while Shaft06.MetalDoor.Transparency > 0.0 do
			Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft07.MetalDoor.CanCollide == false then
		Shaft07.MetalDoor.CanCollide = true
		while Shaft07.MetalDoor.Transparency > 0.0 do
			Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft08.MetalDoor.CanCollide == false then
		Shaft08.MetalDoor.CanCollide = true
		while Shaft08.MetalDoor.Transparency > 0.0 do
			Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1
			wait(0.000001)
		end

	end
	if Shaft09.MetalDoor.CanCollide == false then
		Shaft09.MetalDoor.CanCollide = true
		while Shaft09.MetalDoor.Transparency > 0.0 do
			Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
	if Shaft10.MetalDoor.CanCollide == false then
		Shaft10.MetalDoor.CanCollide = true
		while Shaft10.MetalDoor.Transparency > 0.0 do
			Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
	if Shaft11.MetalDoor.CanCollide == false then
		Shaft11.MetalDoor.CanCollide = true
		while Shaft11.MetalDoor.Transparency > 0.0 do
			Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
	if Shaft12.MetalDoor.CanCollide == false then
		Shaft12.MetalDoor.CanCollide = true
		while Shaft12.MetalDoor.Transparency > 0.0 do
			Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
	if Shaft13.MetalDoor.CanCollide == false then
		Shaft13.MetalDoor.CanCollide = true
		while Shaft13.MetalDoor.Transparency > 0.0 do
			Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
end

function onClicked()
DoorClose()

end

script.Parent.MouseButton1Click:connect(onClicked)

script.Parent.MouseButton1Click:connect(function()
	if clicker == true
		then clicker = false
	else
		return

	end
end)

script.Parent.MouseButton1Click:connect(function()
Car.Touched:connect(function(otherPart)
	if otherPart == Elevator.Floors.F09
		then StopE() DoorOpen()
	end
end)end)

function StopE()
 Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
 Car.BodyPosition.position = Elevator.Floors.F09.Position
	clicker = true
end

function DoorOpen()
	while Shaft08.MetalDoor.Transparency < 1.0 do
	Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency + .1
	wait(0.000001)
	end
	Shaft08.MetalDoor.CanCollide = false
end


Response:
function onRunning(speed)
	if speed>0.01 then
		playAnimation("walk", 0.1, Humanoid)
		if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
			setAnimationSpeed(speed / 14.5)
		end
		pose = "Running"
	else
		playAnimation("idle", 0.1, Humanoid)
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / 12.0)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()

	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid)
		return
	end
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then


Prompt: -------- OMG HAX

Response:
r = game:service("RunService")

local damage = 0

local slash_damage = 3
local lunge_damage = 5

sword = script.Parent.Center
Tool = script.Parent

local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1

function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		print("SWORD HIT")
		tagHumanoid(humanoid, vPlayer)
		humanoid:TakeDamage(damage)
		wait(1)
		untagHumanoid(humanoid)
	end
end

function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool

	force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(0,-1,0)
	Tool.GripRight = Vector3.new(-1,0,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(-1,0,0)
	Tool.GripUp = Vector3.new(0,1,0)
end

function swordAcross()
	-- parry
end

Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return
	end

	t = r.Stepped:wait()

	if (t - last_attack < 0) then
		lunge()
	else
		attack()
	end

	last_attack = t

	wait(.75)

	Tool.Enabled = true
end

function onEquipped()
	UnsheathSound:play()
end

script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

connection = sword.Touched:connect(blow)


Prompt:
--[=[
	Observes an instance's ancestry

	@param instance Instance
	@return Observable<Instance>
]=]

Response:
function RxInstanceUtils.observeAncestry(instance)
	local startWithParent = Rx.start(function()
		return instance, instance.Parent
	end)

	return startWithParent(Rx.fromSignal(instance.AncestryChanged))
end


Prompt: --Feel free to poke around and see how this works.  It's not very complex

Response:
local car = script.Parent.Car.Value
local Values = script.Parent:WaitForChild("Values") --This bit of code is still in 90% of A-Chassis plugins lol
local _Tune = require(car["A-Chassis Tune"])
local Handler = car:WaitForChild("ExhaustHandler")
local IsFlaming = false --Exhaust flame debounce.  Debounces are important so code block doesn't run too quickly

Values.Throttle.Changed:Connect(function() -- This is where all the magic happens.  Flames are determined by when you release the throttle

	local RPMRatio = Values.RPM.Value / _Tune.Redline

	print(RPMRatio)

	if RPMRatio > 0.8 and not IsFlaming and car.DriveSeat.Throttle < 1 then

		IsFlaming = true
		Handler:FireServer("Flames",true)
		wait(0.1)
		Handler:FireServer("Flames",false)
		Handler:FireServer("FlamesSmall",true)
		wait(1)
		Handler:FireServer("FlamesSmall",false)
		IsFlaming = false
	elseif Values.Throttle.Value < 0.5 then

		Handler:FireServer("FlamesSmall",false)

	end

end)


Prompt: --	dButton:TweenPosition(DpositionNormal, "InOut", "Sine", 0.1)

Response: end)


Prompt: --updated 10/09/2022

Response:
npc= nil
hum= nil
health_gui= script.Parent
health_text= script.Parent:WaitForChild("TextLabel")

if (health_gui.Parent~= nil and health_gui.Parent.ClassName== "Model" and health_gui.Parent:FindFirstChildOfClass("Humanoid")) then
	npc= health_gui.Parent
	hum= health_gui.Parent:FindFirstChildOfClass("Humanoid")

elseif (health_gui.Parent.Parent~= nil and health_gui.Parent.Parent.ClassName== "Model" and health_gui.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
	npc= health_gui.Parent.Parent
	hum= health_gui.Parent.Parent:FindFirstChildOfClass("Humanoid")

elseif (health_gui.Parent.Parent.Parent~= nil and health_gui.Parent.Parent.Parent.ClassName== "Model" and health_gui.Parent.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
	npc= health_gui.Parent.Parent.Parent
	hum= health_gui.Parent.Parent.Parent:FindFirstChildOfClass("Humanoid")
end

if not npc then
	health_gui:Remove()
end

if not hum then
	health_text.Text= "humanoid not found"
	health_text.TextColor3= Color3.fromRGB(255, 255, 127)
end

hum.DisplayDistanceType= Enum.HumanoidDisplayDistanceType.None
hum.HealthDisplayType= Enum.HumanoidHealthDisplayType.AlwaysOff

game["Run Service"].Heartbeat:Connect(function()

	--for text health
	health_text.Text= npc.Name.. " | ".. hum.Health.. " / ".. hum.MaxHealth

	--for color
	local GoodColor= Color3.fromRGB(85, 255, 127)
	local MediumColor= Color3.fromRGB(255, 255, 127)
	local BadColor= Color3.fromRGB(255, 140, 142)

	if hum.Health >= hum.MaxHealth * 0.6 then
		health_text.TextColor3= GoodColor
	end

	if hum.Health <= hum.MaxHealth * 0.6 then
		health_text.TextColor3= MediumColor
	end

	if hum.Health <= hum.MaxHealth * 0.25 then
		health_text.TextColor3= BadColor
	end

end)


Prompt: --cyan 4

Response:
if k == "c" and ibo.Value==true then
	bin.Blade.BrickColor = BrickColor.new("Cyan")
	bin.Blade2.BrickColor = BrickColor.new("Institutional white")
	bin.Blade.White.Enabled=false colorbin.white.Value = false
	bin.Blade.Blue.Enabled=false colorbin.blue.Value = false
	bin.Blade.Green.Enabled=false colorbin.green.Value = false
	bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
	bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
	bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
	bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
	bin.Blade.Red.Enabled=false colorbin.red.Value = false
	bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
	bin.Blade.Black.Enabled=false colorbin.black.Value = false
	bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
	bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false
	bin.Blade.Cyan.Enabled=true colorbin.cyan.Value = true
    end


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 175		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6200		--		Use sliders to manipulate values
	Tune.Redline		= 7600		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16

	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)

	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 1		-- Clutch engagement threshold (higher = faster response)


Prompt: -- Hide command bar when Enter key is pressed

Response:
input.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		toggleCommandBar()
	end
end)


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Auto","Manual"}												--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch

		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}
		>First mode is default mode													]]

	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	Tune.AutoUpThresh	= 480		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 50		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)

	--Gear Ratios

	--Gear Ratios
	Tune.FinalDrive		= 3.65			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.45			,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		4.40			,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.75			,
		--[[ 3 ]]		1.85			,
		--[[ 4 ]]		1.40			,
		--[[ 5 ]]		1.00 ,
		--[[ 6 ]]		0.75	,
	}
	Tune.FDMult			= 1.1			-- Ratio multiplier (keep this at 1 if car is not struggling with torque)


Prompt:
--[[
	The entry point for the Fusion library.
]]

Response:
local PubTypes = require(script.PubTypes)
local restrictRead = require(script.Utility.restrictRead)

export type StateObject<T> = PubTypes.StateObject<T>
export type CanBeState<T> = PubTypes.CanBeState<T>
export type Symbol = PubTypes.Symbol
export type Value<T> = PubTypes.Value<T>
export type Computed<T> = PubTypes.Computed<T>
export type ComputedPairs<K, V> = PubTypes.ComputedPairs<K, V>
export type Observer = PubTypes.Observer
export type Tween<T> = PubTypes.Tween<T>
export type Spring<T> = PubTypes.Spring<T>

type Fusion = {
	New: (className: string) -> ((propertyTable: PubTypes.PropertyTable) -> Instance),
	Children: PubTypes.ChildrenKey,
	OnEvent: (eventName: string) -> PubTypes.OnEventKey,
	OnChange: (propertyName: string) -> PubTypes.OnChangeKey,

	Value: <T>(initialValue: T) -> Value<T>,
	Computed: <T>(callback: () -> T) -> Computed<T>,
	ComputedPairs: <K, VI, VO>(inputTable: CanBeState<{[K]: VI}>, processor: (K, VI) -> VO, destructor: (VO) -> ()?) -> ComputedPairs<K, VO>,
	Observer: (watchedState: StateObject<any>) -> Observer,

	Tween: <T>(goalState: StateObject<T>, tweenInfo: TweenInfo?) -> Tween<T>,
	Spring: <T>(goalState: StateObject<T>, speed: number?, damping: number?) -> Spring<T>
}

return restrictRead("Fusion", {
	New = require(script.Instances.New),
	Children = require(script.Instances.Children),
	OnEvent = require(script.Instances.OnEvent),
	OnChange = require(script.Instances.OnChange),

	Value = require(script.State.Value),
	Computed = require(script.State.Computed),
	ComputedPairs = require(script.State.ComputedPairs),
	Observer = require(script.State.Observer),

	Tween = require(script.Animation.Tween),
	Spring = require(script.Animation.Spring)
}) :: Fusion


Prompt: --// Events

Response:
local L_72_ = L_17_:WaitForChild('Equipped')
local L_73_ = L_17_:WaitForChild('ShootEvent')
local L_74_ = L_17_:WaitForChild('DamageEvent')
local L_75_ = L_17_:WaitForChild('CreateOwner')
local L_76_ = L_17_:WaitForChild('Stance')
local L_77_ = L_17_:WaitForChild('HitEvent')


Prompt:
--[[

	MatchTable {
		Some: (value: any) -> any
		None: () -> any
	}

	CONSTRUCTORS:

		Option.Some(anyNonNilValue): Option<any>
		Option.Wrap(anyValue): Option<any>

	STATIC FIELDS:

		Option.None: Option<None>

	STATIC METHODS:

		Option.Is(obj): boolean

	METHODS:

		opt:Match(): (matches: MatchTable) -> any
		opt:IsSome(): boolean
		opt:IsNone(): boolean
		opt:Unwrap(): any
		opt:Expect(errMsg: string): any
		opt:ExpectNone(errMsg: string): void
		opt:UnwrapOr(default: any): any
		opt:UnwrapOrElse(default: () -> any): any
		opt:And(opt2: Option<any>): Option<any>
		opt:AndThen(predicate: (unwrapped: any) -> Option<any>): Option<any>
		opt:Or(opt2: Option<any>): Option<any>
		opt:OrElse(orElseFunc: () -> Option<any>): Option<any>
		opt:XOr(opt2: Option<any>): Option<any>
		opt:Contains(value: any): boolean

	--------------------------------------------------------------------

	Options are useful for handling nil-value cases. Any time that an
	operation might return nil, it is useful to instead return an
	Option, which will indicate that the value might be nil, and should
	be explicitly checked before using the value. This will help
	prevent common bugs caused by nil values that can fail silently.

	Example:

	local result1 = Option.Some(32)
	local result2 = Option.Some(nil)
	local result3 = Option.Some("Hi")
	local result4 = Option.Some(nil)
	local result5 = Option.None

	-- Use 'Match' to match if the value is Some or None:
	result1:Match {
		Some = function(value) print(value) end;
		None = function() print("No value") end;
	}

	-- Raw check:
	if result2:IsSome() then
		local value = result2:Unwrap() -- Explicitly call Unwrap
		print("Value of result2:", value)
	end

	if result3:IsNone() then
		print("No result for result3")
	end

	-- Bad, will throw error bc result4 is none:
	local value = result4:Unwrap()

--]]

Response:
local CLASSNAME = "Option"

local Option = {}
Option.__index = Option

function Option._new(value)
	local self = setmetatable({
		ClassName = CLASSNAME;
		_v = value;
		_s = (value ~= nil);
	}, Option)
	return self
end

function Option.Some(value)
	assert(value ~= nil, "Option.Some() value cannot be nil")
	return Option._new(value)
end

function Option.Wrap(value)
	if value == nil then
		return Option.None
	else
		return Option.Some(value)
	end
end

function Option.Is(obj)
	return type(obj) == "table" and getmetatable(obj) == Option
end

function Option.Assert(obj)
	assert(Option.Is(obj), "Result was not of type Option")
end

function Option.Deserialize(data) -- type data = {ClassName: string, Value: any}
	assert(type(data) == "table" and data.ClassName == CLASSNAME, "Invalid data for deserializing Option")
	return data.Value == nil and Option.None or Option.Some(data.Value)
end

function Option:Serialize()
	return {
		ClassName = self.ClassName;
		Value = self._v;
	}
end

function Option:Match(matches)
	local onSome = matches.Some
	local onNone = matches.None
	assert(type(onSome) == "function", "Missing 'Some' match")
	assert(type(onNone) == "function", "Missing 'None' match")
	if self:IsSome() then
		return onSome(self:Unwrap())
	else
		return onNone()
	end
end

function Option:IsSome()
	return self._s
end

function Option:IsNone()
	return (not self._s)
end

function Option:Expect(msg)
	assert(self:IsSome(), msg)
	return self._v
end

function Option:ExpectNone(msg)
	assert(self:IsNone(), msg)
end

function Option:Unwrap()
	return self:Expect("Cannot unwrap option of None type")
end

function Option:UnwrapOr(default)
	if self:IsSome() then
		return self:Unwrap()
	else
		return default
	end
end

function Option:UnwrapOrElse(defaultFunc)
	if self:IsSome() then
		return self:Unwrap()
	else
		return defaultFunc()
	end
end

function Option:And(optB)
	if self:IsSome() then
		return optB
	else
		return Option.None
	end
end

function Option:AndThen(andThenFunc)
	if self:IsSome() then
		local result = andThenFunc(self:Unwrap())
		Option.Assert(result)
		return result
	else
		return Option.None
	end
end

function Option:Or(optB)
	if self:IsSome() then
		return self
	else
		return optB
	end
end

function Option:OrElse(orElseFunc)
	if self:IsSome() then
		return self
	else
		local result = orElseFunc()
		Option.Assert(result)
		return result
	end
end

function Option:XOr(optB)
	local someOptA = self:IsSome()
	local someOptB = optB:IsSome()
	if someOptA == someOptB then
		return Option.None
	elseif someOptA then
		return self
	else
		return optB
	end
end

function Option:Filter(predicate)
	if self:IsNone() or not predicate(self._v) then
		return Option.None
	else
		return self
	end
end

function Option:Contains(value)
	return self:IsSome() and self._v == value
end

function Option:__tostring()
	if self:IsSome() then
		return ("Option<" .. typeof(self._v) .. ">")
	else
		return "Option<None>"
	end
end

function Option:__eq(opt)
	if Option.Is(opt) then
		if self:IsSome() and opt:IsSome() then
			return (self:Unwrap() == opt:Unwrap())
		elseif self:IsNone() and opt:IsNone() then
			return true
		end
	end
	return false
end

Option.None = Option._new()

return Option


Prompt: --[[Steering]]

Response:
Tune.SteerInner		= 32		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 33		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .02		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .04		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree


Prompt: --Put this in StarterPlayer, StarterCharacterScripts

Response:
local human = script.Parent:WaitForChild("Humanoid")

local AttackArm = true

local canattack = true

game:GetService("UserInputService").InputBegan:connect(function(input, gamepor)
	if (input.KeyCode == Enum.KeyCode.X or input.KeyCode == Enum.KeyCode.ButtonY) and canattack then
		canattack = false
		script.RemoteEvent:FireServer(AttackArm)
		human:LoadAnimation(AttackArm and script.R or script.L):Play()
		wait(0.6)
		AttackArm = not AttackArm
		canattack = true
	end
end)


Prompt: --NOTE: We create the rocket once and then clone it when the player fires

Response:
local Rocket = Instance.new('Part') do
	-- Set up the rocket part
	Rocket.Name = 'Rocket'
	Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	Rocket.Size = ROCKET_PART_SIZE
	Rocket.CanCollide = false
	Rocket.Anchored = true

	-- Add the mesh
	local mesh = Instance.new('SpecialMesh', Rocket)
	mesh.MeshId = MISSILE_MESH_ID
	mesh.Scale = MISSILE_MESH_SCALE

	-- Add fire
	local fire = Instance.new('Fire', Rocket)
	fire.Heat = 5
	fire.Size = 2

	-- Clone the sounds and set Boom to PlayOnRemove
	local swooshSoundClone = SwooshSound:Clone()
	swooshSoundClone.Parent = Rocket
	local boomSoundClone = BoomSound:Clone()
	boomSoundClone.PlayOnRemove = true
	boomSoundClone.Parent = Rocket

	-- Attach creator tags to the rocket early on
	local creatorTag = Instance.new('ObjectValue', Rocket)
	creatorTag.Value = MyPlayer
	creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
	local iconTag = Instance.new('StringValue', creatorTag)
	iconTag.Value = Tool.TextureId
	iconTag.Name = 'icon'

	-- Finally, clone the rocket script and enable it
	local rocketScriptClone = RocketScript:Clone()
	rocketScriptClone.Parent = Rocket
	rocketScriptClone.Disabled = false
end


Prompt: --- RUNTIME ---

Response:
local Tool = {}

Tool.MouseButton1 = function(Character)
	if Character:GetAttribute("Cooldown") == true then return end
	Character:SetAttribute("Cooldown", true)

	Character.Humanoid:LoadAnimation(script.Animation):Play()

	Character[script.Name].Handle.Swing:Play()

	local MousePosition = MousePosition:InvokeClient(Players:GetPlayerFromCharacter(Character))
	-- Character.PrimaryPart.CFrame = CFrame.new(Character.PrimaryPart.Position, MousePosition) -- Points character at mouse, at extreme angles it trips so I'm disabling for now

	task.wait(0.33)

	Character[script.Name].Handle.Shoot:Play()

	Projectile(Character, MousePosition)

	task.wait(2)

	Character:SetAttribute("Cooldown", false)
end

return Tool


Prompt:
-- Component
-- Stephen Leitnick
-- November 26, 2021

Response: type AncestorList = {Instance}