Pinkstack/roblox-luau-corpus-text huggingface dataset:
--!strict


local Array = script.Parent.Parent
local LuauPolyfill = Array.Parent
local types = require(LuauPolyfill.types)
type Object = types.Object

type Array<T> = types.Array<T>
type mapFn<T, U> = (element: T, index: number) -> U
type mapFnWithThisArg<T, U> = (thisArg: any, element: T, index: number) -> U

return function<T, U>(
	value: Array<T>,
	mapFn: (mapFn<T, U> | mapFnWithThisArg<T, U>)?,
	thisArg: Object?
	-- FIXME Luau: need overloading so the return type on this is more sane and doesn't require manual casts
): Array<U> | Array<T> | Array<string>
	local array = {}

	if mapFn then
		local arrayLength = #(value :: Array<T>)
		array = table.create(arrayLength)
		for i = 1, arrayLength do
			if thisArg ~= nil then
				(array :: Array<U>)[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, (value :: Array<T>)[i], i)
			else
				(array :: Array<U>)[i] = (mapFn :: mapFn<T, U>)((value :: Array<T>)[i], i)
			end
		end
	else
		array = table.clone(value :: Array<T>)
	end

	return array
end
---------------------------------------------------------------


function onChildAdded(child)
	if child.Name == "SeatWeld" then
		local human = child.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			print("Human IN")
			seat.SirenPanel.Control.CarName.Value = human.Parent.Name.."'s Car"
			seat.Parent.Name = human.Parent.Name.."'s Car"
			s.Parent.SirenPanel:clone().Parent = game.Players:findFirstChild(human.Parent.Name).PlayerGui
		end
	end
end

function onChildRemoved(child)
	if (child.Name == "SeatWeld") then	
		local human = child.part1.Parent:findFirstChild("Humanoid") 
		if (human ~= nil) then
			print("Human OUT")
			seat.Parent.Name = "Empty Car"
			seat.SirenPanel.Control.CarName.Value = "Empty Car"
			game.Players:findFirstChild(human.Parent.Name).PlayerGui.SirenPanel:remove()
		end
	end
end


script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
-- ================================================================================
-- Settings - Speedster
-- ================================================================================



local Settings = {}

Settings.DefaultSpeed = 125		-- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 200		-- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 6		-- Duration of boost in seconds
Settings.Steering = 5			-- How quickly the speeder turns [Range: 1-10]
--[=[
	Works line combineLatest, but allow the transformation of a brio into an observable
	that emits the value, and then nil, on death.

	The issue here is this:

	1. Resources are found with combineLatest()
	2. One resource dies
	3. All resources are invalidated
	4. We still wanted to be able to use most of the resources

	With this method we are able to do this, as we'll re-emit a table with all resoruces
	except the invalidated one.

	@since 3.6.0
	@param observables { [any]: Observable<Brio<T>> | Observable<T> | T }
	@return Observable<{ [any]: T? }>
]=]


function RxBrioUtils.flatCombineLatest(observables)
	assert(type(observables) == "table", "Bad observables")

	local newObservables = {}
	for key, observable in pairs(observables) do
		if Observable.isObservable(observable) then
			newObservables[key] = RxBrioUtils.flattenToValueAndNil(observable)
		else
			newObservables[key] = observable
		end
	end

	return Rx.combineLatest(newObservables)
end
--[[
	Evercyan @ March 2023
	Tween
	
	Tween is a utility wrapper used to conveniently create & play tweens in a short & quick fashion.
	A wrapper basically takes an existing feature (TweenService) and adds code on top of it for extra functionality.
	
	---- Roblox TweenService:
	local Tween = TweenService:Create(Lighting, {1, Enum.EasingStyle.Exponential, Enum.EasingDirection.In}, {Brightness = 0})
	Tween:Play()
	
	---- Tween Wrapper:
	local Tween = Tween:Play(Lighting, {1, "Expontential", "In"}, {Brightness = 0})
]]
------------------------------------------------------------------------
-- codes loading of nil, optimization done if consecutive locations
-- * used in luaK:discharge2reg(), (lparser) luaY:adjust_assign()
------------------------------------------------------------------------


function luaK:_nil(fs, from, n)
  if fs.pc > fs.lasttarget then  -- no jumps to current position?
    if fs.pc == 0 then  -- function start?
      if from >= fs.nactvar then
        return  -- positions are already clean
      end
    else
      local previous = fs.f.code[fs.pc - 1]
      if luaP:GET_OPCODE(previous) == "OP_LOADNIL" then
        local pfrom = luaP:GETARG_A(previous)
        local pto = luaP:GETARG_B(previous)
        if pfrom <= from and from <= pto + 1 then  -- can connect both?
          if from + n - 1 > pto then
            luaP:SETARG_B(previous, from + n - 1)
          end
          return
        end
      end
    end
  end
  self:codeABC(fs, "OP_LOADNIL", from, from + n - 1, 0)  -- else no optimization
end
--[[Steering]]



	function Steering()
		--Mouse Steer
		if _MSteer then
			local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
			local mdZone = _Tune.Peripherals.MSteerDZone/100
			local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
			if math.abs(mST)<=mdZone then
				_GSteerT = 0
			else
				_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
			end
		end
		
		--Interpolate Steering
		if _GSteerC < _GSteerT then
			if _GSteerC<0 then
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)
			else
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
			end
		else
			if _GSteerC>0 then
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)
			else
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
			end
		end
		
		--Steer Decay Multiplier
		local sDecay = (1-math.min(car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		
		--Apply Steering
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="F" then
				v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
			elseif v.Name=="FL" then
				if _GSteerC>= 0 then
					v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
				else
					v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
				end
			elseif v.Name=="FR" then
				if _GSteerC>= 0 then
					v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
				else
					v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
				end
			end
		end
	end
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function Receive(player, action, ...)
	local args = {...}
	if player == User and action == "play" then
		Connector:FireAllClients("play", User, args[1], Settings.SoundSource.Position, Settings.PianoSoundRange, Settings.PianoSounds, args[2], Settings.IsCustom)
		HighlightPianoKey((args[1] > 61 and 61) or (args[1] < 1 and 1) or args[1],args[3])
	elseif player == User and action == "abort" then
		Deactivate()
		if SeatWeld then
			SeatWeld:remove()
		end
	end
end

function Activate(player)
	Connector:FireClient(player, "activate", Settings.CameraCFrame, Settings.PianoSounds, true)
	User = player
	for i,v in pairs(Piano.Keys.Keys:GetChildren()) do
		local obj = v
		local Properties = {}
		Properties.Transparency = 0
		Tween(obj,Properties,1,false,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
	end
end

function Deactivate()
	if User and User.Parent then
		Connector:FireClient(User, "deactivate")
		User.Character:SetPrimaryPartCFrame(Box.CFrame + Vector3.new(0, 5, 0))
	end
	for i,v in pairs(Piano.Keys.Keys:GetChildren()) do
		local obj = v
		local Properties = {}
		Properties.Transparency = 1
		Tween(obj,Properties,1,false,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
	end
	User = nil
end
--[=[
	Uses the constructor to attach a class or resource to the actual object
	for the lifetime of the subscription of that object.

	```lua
	return Blend.New "Frame" {
		Parent = variables.Parent;
		[Blend.Attached(function(parent)
			local maid = Maid.new()

			print("Got", parent)

			maid:GiveTask(function()
				print("Dead!")
			end)

			return maid
		end)] = true;
	}
	```

	@param constructor T
	@return (parent: Instance) -> Observable<T>
]=]


function Blend.Attached(constructor)
	return function(parent)
		return Observable.new(function(sub)
			local maid = Maid.new()

			local resource = constructor(parent)

			if MaidTaskUtils.isValidTask(resource) then
				maid:GiveTask(resource)
			end

			sub:Fire(resource)

			return maid
		end)
	end;
end
--[=[
	@param object any -- Object to remove
	Removes the object from the Janitor and cleans it up.

	```lua
	local part = Instance.new("Part")
	Janitor:Add(part)
	Janitor:Remove(part)
	```
]=]


function Janitor:Remove(object: any): boolean
	local objects = self._objects
	for i,obj in ipairs(objects) do
		if obj[1] == object then
			local n = #objects
			objects[i] = objects[n]
			objects[n] = nil
			self:_cleanupObject(obj[1], obj[2])
			return true
		end
	end
	return false
end
-- Uber l33t maths to calcluate the angle needed to throw a projectile a distance, given the altitude of the end point and the projectile's velocity


function AngleOfReach(distance, altitude, velocity)
	local theta = math.atan((velocity^2 + math.sqrt(velocity^4 -200*(200*distance^2 + 2*altitude*velocity^2)))/(200*distance))
	if theta ~= theta then
		theta = math.pi/4
	end
	return(theta)
end
-- table.concat but allows booleans


local function tableConcat(t, sep)
	for i, v in t do
		if type(v) == "boolean" then
			t[i] = tostring(v)
		end
	end
	
	table.concat(t, sep)
	
	return t
end

local function dumpFormatter(dump, start, ending)
	-- "\n\n -- " .. start .. " --\n\n" .. dump .. "\n -- " .. ending .. " --"	
	return `\n\n -- {start} --\n\n{dump}\n -- {ending} --\n`
end

local class = {}

function ErrorFormat(title: string, nonFatal: boolean?, traceback: string?)
	return function(errorMessage: string)
		errorMessage = `{title} {errorMessage}{dumpFormatter(traceback or debug.traceback(nil, 2), "Stack Trace", "Stack End")}`
		
		if nonFatal then
			task.spawn(error, errorMessage, 0)
		else
			error(errorMessage, 0)
		end
	end
end

return ErrorFormat
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- 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.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		0		,	-- positive = outward
	 --[[Vertical]]		-1.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[[
	Function called upon entering the state - creates the systems, and initialises the game loop.
]]


function ServerGame.onEnter(stateMachine, event, from, to)
	SystemManager.createSystems()

	local engine = SystemManager.getSystemByName("engine")

	local function completeGame()
		stateMachine:finishGame()
	end
	connections.crashedIntoSun = engine.crashedIntoSun:Connect(completeGame)

	connections.escapedSun = engine.escapedSun:Connect(completeGame)

	spawnToolsAsync()
	tagMap()

	coroutine.wrap(
		function()
			while true do
				local waitTime = METEOR_FREQUENCY_PER_PLAYER / 1 + (#Players:GetPlayers() / 5)

				wait(math.random(waitTime / 1.5, waitTime * 1.5))
				if stateMachine.current ~= "game" then
					return
				end

				local shield = SystemManager.getSystemByName("shield")

				if shield:isOn() and math.random(1, 100) > SHIELD_DEFLECT_RATE then
					sendAlert(Constants.Alert.Success, translate("Shields have deflected a meteor!"))
				else
					spawnMeteor()
				end
			end
		end
	)()
end
--[[
	Utility script that holds a cache of player character appearances. Allows the game to load appearances as soon as the player enters the game, thereby reducing
	risk of lengthy Roblox server requests slowing down critial times in the game loop.
]]


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

local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger)

local CharacterAppearanceCache = {}

local appearanceCache = {}
--// Functions




UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.X then
		if Chatting == true then
			Skip = true
			Sounds.Click:Play()
		end
	end
end)

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Z then
		if Chatting == true then
			Exit = true
			Sounds.Click:Play()
		end
	end
end)

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.E then
		
		
		if Detected == true then
			local Lines = DetectedNPC:FindFirstChild("Lines")
			
			if Lines then
				Sounds.Click:Play()
				
				Chatting = true
				Detected = false
				
				LineLabel.Text = " "
				
				PromptLabel:TweenSize(UDim2.new(0, 0, 0, 0), "Out", "Linear", 0.2)
				LineLabel:TweenPosition(UDim2.new(0, 0, 0.8, 0), "In", "Linear", 0.2)
				
				wait(0.5)
				
				for i, Line in pairs(Lines:GetChildren()) do
					local Text = Line.Value
					
					for i = 1, #Text do
						LineLabel.Text = string.sub(Text, 1, i)
						Sounds.Talk:Play()
						if Skip == true then
							Skip = false
							LineLabel.Text = Text
							break
						end
						if Exit == true then
							break
						end
						wait(0.07)
					end
					if Exit == true then
						Exit = false
						break
					end
					repeat wait() until Skip == true or Exit == true
					Skip = false
				end
				
				Exit = false
				Skip = false
				
				PromptLabel:TweenSize(UDim2.new(0, 0, 0, 0), "Out", "Linear", 0.2)
				LineLabel:TweenPosition(UDim2.new(0, 0, 1.2, 0), "Out", "Linear", 0.2)
				
				wait(0.5)
				
				Chatting = false
				Detected = false
			end
		end
	end
end)
---Setting events to all buttons



ButtonsPanel.Lights.MouseButton1Click:Connect(function()
	---Checking if the player is in a vehicle
	if Char.Humanoid.SeatPart ~= nil and Char.Humanoid.SeatPart.Parent:FindFirstChild("Stats") then
		
		Char.Humanoid.SeatPart.Parent.VehicleSeat.ChassisMain["Lights"]:FireServer()
	end	
end)	

ButtonsPanel.Flip.MouseButton1Click:Connect(function()
	---Checking if the player is in a vehicle
	if Char.Humanoid.SeatPart ~= nil and Char.Humanoid.SeatPart.Parent:FindFirstChild("Stats") and FlipCD == false then
		FlipCD = true
		local Gyro = Char.Humanoid.SeatPart.Parent.Engine.Stability
		
		Gyro.D = 100
		Gyro.P = 2000
		Gyro.MaxTorque = Vector3.new(1800,0,1800)
		wait(3)
		Gyro.D = 11
		Gyro.P = 11
		Gyro.MaxTorque = Vector3.new(6,6,6)		
		
		wait(5)
		FlipCD = false
	end	
end)
-- Controls the field-of-view of the camera depending on the player's setting.
-- 
-- ForbiddenJ



NormalFov = 70
WideFov = 85

Camera = workspace.CurrentCamera
FovSetting = game.ReplicatedStorage.ClientConfig.WideFOV

function Update()
	Camera.FieldOfView = FovSetting.Value and WideFov or NormalFov
end

FovSetting:GetPropertyChangedSignal("Value"):Connect(Update)

Update()
--tables


local SoundTable = {}
local AnimTable = {}


local function PickThing(ThingToPick)
	if ThingToPick == "Swing" then
		--pick anim
		local SwingA = AnimTable[R:NextInteger(1, #AnimTable)]
		local findA = Tool.Animations:findFirstChild(SwingA)
		return findA
	elseif ThingToPick == "Sound" then
		--pick sound
		local SoundA = SoundTable[R:NextInteger(1, #SoundTable)]
		local findA = Tool.Sounds:findFirstChild(SoundA)
		return findA
	end
end

 --check if trables have been filled
function CheckTables()
	if LoadedTables == false then
		local GetS = Tool.Sounds:GetChildren()
		local GetA = Tool.Animations:GetChildren()
		for i = 1, #GetS do
			if GetS[i].Name ~= "Equip" then --ignore equip sound
				table.insert(SoundTable, tostring(GetS[i].Name))
			end
		end
		for i = 1, #GetA do
			if GetA[i].Name ~= "Equip" then --ignore equip animation
				table.insert(AnimTable, tostring(GetA[i].Name))
			end
		end
		LoadedTables = true
	end
end
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
		--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				=  Enum.KeyCode.Pause				,
		ToggleABS				=  Enum.KeyCode.Pause						,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.Pause				,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
------------------------



function Key(key)
if key then
key = string.lower(key)
if (key=="x") then
if on == 1 then
Tool.Parent.Humanoid.WalkSpeed = CurrentWalkSpeed
on = 0
elseif on == 0 then
Tool.Parent.Humanoid.WalkSpeed = WalkSpeedWhileCrouching
on = 1
end
Crouch(on)
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)
-- Render the map at 0FPS (static since we know it doesn't change)



	for i,d in pairs(workspace:GetDescendants()) do
		local isHum = false
		if d.Parent then
			local hum = d.Parent:FindFirstChild("Humanoid")
			if hum then
				if hum:IsA("Humanoid") then
					isHum = true
				end
			end
		end
		if d:IsA("BasePart") and not d:IsA("Terrain") and not isHum then
			local mapObj_Handler = VF_Handler:RenderObject(d, 30)
		end
	end
--- Rainbow FX




return function(gui, property, speed)
	--- Variables
	speed = speed or 1
	--
	local running = true
	
	--- Main
	coroutine.wrap(function()
		local _tick = tick()
		--
		while gui and gui.Parent and running do
			--- Math
			local i = (tick() - _tick) * (1.0 / speed)
			if i >= 1 then  
				_tick = tick()  
				i = 0  
			end
			
			--- Apply
			gui[property] = Color3.fromHSV(i, 1, 1)
			
			--- Wait
			_L.Services.RunService.Stepped:wait()
		end
	end)()
	
	--- Return function to cancel this behavior
	return function()
		running = false
	end
end
--Rescripted by Luckymaxer



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

Players = game:GetService("Players")

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

ClientControl.OnClientInvoke = (function(Mode, Value)
	if Mode == "PlaySound" and Value then
		Value:Play()
	end
end)

function InvokeServer(Mode, Value, arg)
	pcall(function()
		ServerControl:InvokeServer(Mode, Value, arg)
	end)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not Player or not Humanoid or Humanoid.Health == 0 then
		return
	end
	Mouse.Button1Down:connect(function()
		InvokeServer("Click", true, Mouse.Hit.p)
	end)
end

local function Unequipped()
	
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
-- The subset of a Promise that React APIs rely on. This resolves a value.
-- This doesn't require a return value neither from the handler nor the
-- then function.
-- ROBLOX FIXME: workaround for Luau recursive type used with different parameters. delete this copy once that issue is resolved.


export type _Thenable<R> = {
	andThen: <U>(
		self: _Thenable<R>,
		onFulfill: (R) -> () | U,
		onReject: (error: any) -> () | U
	) -> (),
}

export type Thenable<R> = {
	andThen: <U>(
		self: Thenable<R>,
		onFulfill: (R) -> () | _Thenable<U> | U,
		onReject: (error: any) -> () | _Thenable<U> | U
		-- ROBLOX FIXME Luau: need union type packs to parse () | Thenable<U>: CLI-49836
	) -> nil | _Thenable<U>,
}

return exports
--Funcion Del AutoClick


local plr = script.Parent.Parent.Parent
local timeAuto = plr.PlayerStats.timeAuto

local lea = plr:WaitForChild("leaderstats")-- Nombre De La Carpeta De Su Sistema De Dinero
local gold = lea:WaitForChild("TimesClicked")-- Nombre De Su Sistema De Dinero
local coin = lea:WaitForChild("Coins")-- Nombre De Su Sistema De Dinero
local boost = plr:WaitForChild("CoinBoost")-- Nombre De Su Sistema De Dinero
local world = plr:WaitForChild("WorldBoost")-- Nombre De Su Sistema De Dinero
local autoclick = false
local autoclickDD = false
function GetAuto()
	gold.Value = gold.Value +1 --Cambiar Por Cuanto Dinero Quieres Que Obtenga
	coin.Value = coin.Value + 1 + 1*boost.Value*world.Value
end

script.Parent.AutoClick.MouseButton1Click:Connect(function()
	if autoclick == false then
		autoclick = true
		script.Parent.AutoClick.Text = "ON"
	else
		autoclick = false
		script.Parent.AutoClick.Text = "OFF"
	end
end)

while wait()do
	if autoclick == true then
		if autoclickDD == false then
			autoclickDD = true
			GetAuto(1)-- Cambia El Tiempo De Espera Al Recargar
			wait(timeAuto.Value)-- Tambien Cambia Para El Tiempo De Espera Al Recargar
			autoclickDD = false
		end
	end
end