Roblox/luau_corpus huggingface dataset:
--[[
	Converts an event into a Promise with an optional predicate
]]
function Promise.fromEvent(event, predicate)
	predicate = predicate or function()
		return true
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
		local connection
		local shouldDisconnect = false

		local function disconnect()
			connection:Disconnect()
			connection = nil
		end

		-- We use shouldDisconnect because if the callback given to Connect is called before
		-- Connect returns, connection will still be nil. This happens with events that queue up
		-- events when there's nothing connected, such as RemoteEvents

		connection = event:Connect(function(...)
			local callbackValue = predicate(...)

			if callbackValue == true then
				resolve(...)

				if connection then
					disconnect()
				else
					shouldDisconnect = true
				end
			elseif type(callbackValue) ~= "boolean" then
				error("Promise.fromEvent predicate should always return a boolean")
			end
		end)

		if shouldDisconnect and connection then
			return disconnect()
		end

		onCancel(disconnect)
	end)
end
--[[ @brief Reshuffles the heap if a given index is smaller than its parent.
--]]
function Heap:_HeapifyBottomUp(i)
	local parent = math.floor(i / 2);
	while self[parent] and self.Comparator(self[i], self[parent]) do
		self[parent], self[i] = self[i], self[parent];
		i = parent;
		parent = math.floor(i / 2);
	end
end
-- Runs when a round finishes. Reloads all players back into the lobby, removing tools and listeners. 
function PlayerManager:ResetPlayers()
	for _, player in ipairs(PlayerManager.ActivePlayers) do
		print(player.Name)
		CheckpointEvent:FireClient(player, {{"raceFinished"}})
		CheckpointEvent:FireClient(player, {{"reset"}})
		PlayerConverter:SpeederToPlayerServer(player)
	end
	PlayerManager.ActivePlayers = {}
end
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local throt=0
local redline=0

script:WaitForChild("Super")


for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

handler:FireServer("newSound","Super",car.DriveSeat,script.Super.SoundId,0,script.Super.Volume,true)
handler:FireServer("playSound","Super")
car.DriveSeat:WaitForChild("Super")

while wait() do
	local _RPM = script.Parent.Values.RPM.Value
	
	if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
		throt = math.max(.3,throt-.2)	
	else
		throt = math.min(1,throt+.1)	
	end	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
		redline=.5
	else
		redline=1
	end
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	local Pitch = math.max((((script.Super.SetPitch.Value + script.Super.SetSuper.Value*_RPM/_Tune.Redline))*on^2),script.Super.SetPitch.Value)
	if FE then
		handler:FireServer("updateSound","Super",script.Super.SoundId,Pitch,script.Super.Volume)
	else
		car.DriveSeat.Super.Pitch = Pitch
	end
end
--[[
	Remove all art placed by a player.
]]
function PlayerSpots:cleanup(player)
	self:_removeUnusedSpots(player)

	for _, placed in ipairs(self.placedSpots) do
		placed.spot:removeArt()
	end

	self.placedSpots = {}
end

function PlayerSpots:_hasArtOnCanvas(canvas)
	for _, placed in ipairs(self.placedSpots) do
		if placed.canvas == canvas then
			return true
		end
	end

	return false
end

function PlayerSpots:_assignRandomSpot(canvas)
	local isSuccess, spot = canvas:getEmptySpot()
	if not isSuccess then
		warn("Cannot find an empty slot in canvas")
		return false, constants.Errors.SpotNotAvailable
	end

	table.insert(self.placedSpots, {
		canvas = canvas,
		spot = spot,
		createdAt = DateTime.now().UnixTimestamp,
	})

	return true, spot
end

function PlayerSpots:_removeOldestArt()
	self.toRemove = 1
end

function PlayerSpots:_removeOldestArtFromCanvas(canvas)
	local toRemove = nil
	for i, placed in ipairs(self.placedSpots) do
		if placed.canvas == canvas then
			-- A spot previously placed by the user has to be freed immediately
			toRemove = i
			placed.spot:removeArt()
			break
		end
	end

	table.remove(self.placedSpots, toRemove)
end

function PlayerSpots:_removeOldestArtFromOtherCanvas(currentCanvas)
	for i, placed in ipairs(self.placedSpots) do
		if placed.canvas ~= currentCanvas then
			self.toRemove = i
			break
		end
	end
end

function PlayerSpots:_removeUnusedSpots(player)
	self.placedSpots = Cryo.List.filter(self.placedSpots, function(placedSpot)
		return placedSpot.spot:hasArt() and placedSpot.spot.ownerUserId == player.UserId
	end)
end

return PlayerSpots
--[=[
	Clears the custom value for the given players. This
	just loops through the list of players and calls
	the `ClearFor` method for each player.
]=]
function RemoteProperty:ClearForList(players: { Player })
	for _, player in ipairs(players) do
		self:ClearFor(player)
	end
end
-- when a spring has displacement and velocity below +/- epsilon, the spring
-- won't send updates
local MOVEMENT_EPSILON = 0.0001
-- Dark was here.
local nearplayer
local Players = game:GetService("Players")
function MoveShelly()
	
	nearplayer = false

	for _,Player in next, Players:GetPlayers() do 
		if Player.Character and Player.Character.PrimaryPart then
			local dis = (Player.Character.PrimaryPart.CFrame.Position - shelly.PrimaryPart.CFrame.Position).Magnitude
			if dis >= 500 then
				nearplayer = true
				break
			end
		end
	end

	if nearplayer then
		task.wait(math.random(8, 8 + 8/2))
		return
	end
	
	bp.Parent = shelly.PrimaryPart
	local goal
	repeat 
	local ray = Ray.new(Vector3.new(origin.p.x+math.random(-tether,tether), shelly.PrimaryPart.Position.Y+100, origin.p.z+math.random(-tether,tether)),Vector3.new(0,-130,0))
	local part,pos,norm,mat = workspace:FindPartOnRay(ray, shelly)
	if part == workspace.Terrain and mat ~= Enum.Material.Water then
		goal = pos+Vector3.new(0,.35,0)
	end
	task.wait()
	until goal
	--Set new goal for banto to MoveTo :)
	local pos = shelly.PrimaryPart.Position
	local cf = CFrame.new(Vector3.new(pos.X, 0, pos.Z), Vector3.new(goal.X, 0, goal.Z))
	bg.CFrame = cf
	bp.Position = (cf*CFrame.new(0,0,-100)).p
	
	local start = tick()
	repeat task.wait(.5)
	local ray = Ray.new(shelly.PrimaryPart.Position, Vector3.new(0,-140,0))
	
	until (shelly.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >15 or not shellyGood
	if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
	bp.Parent = nil
	task.wait(math.random(3,8))
end


local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren()
shelly.Health.Changed:connect(function()
	if shellyGood then
		bp.Parent,bg.Parent= nil,nil
		shelly.PrimaryPart.Transparency =1
		shelly.PrimaryPart.CanCollide = false
		shelly.Shell.Transparency = 1
		shelly.HitShell.Transparency = 0
		shelly.HitShell.CanCollide = true
		shellyGood = false
		ostrich = os.clock()
		shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
		local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
		hitSound.PlayOnRemove = true
		hitSound.Parent = shelly.PrimaryPart
		task.wait()
		hitSound:Destroy()
		
		repeat task.wait() until os.clock()-ostrich > 10
		shelly.PrimaryPart.Transparency = 0
		shelly.PrimaryPart.CanCollide = true
		shelly.Shell.Transparency = 0
		shelly.HitShell.Transparency = 1
		shelly.HitShell.CanCollide = false
		bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
		shellyGood = true
	end
end)

while true do
	if shellyGood then
		MoveShelly()
	else
		task.wait(1)
	end 
end
--[[
	Configuration
]]

local MAX_CUTTOFF_DISTANCE = 12
local ACTIVATE_KEYBOARD = Enum.KeyCode.E
local ACTIVATE_CONSOLE = Enum.KeyCode.ButtonX
local ACTION_BUTTON_OFFSET = Vector2.new(0, 0)
local ACTION_PRIORITY = 10000
--Modules--
local modules = script.Parent.Modules
local core = require(modules.Core)
local combat = require(modules.Combat)
local flight = require(modules.Flight)
local pathing = require(modules.Pathing)
local troubleshoot = require(modules.Troubleshoot)
-- Reference

local soundService = game:GetService("SoundService")
local chat = game:GetService("Chat")
local players = game:GetService("Players")
local lighting = game:GetService("Lighting")
--[=[
	Based on the given [UserInputType], a cooresponding enum representing the
	current device is returned.

	```lua
	getCurrentDevice(Enum.UserInputType.KeyCode) -- "Computer"
	getCurrentDevice(Enum.UserInputType.Touch) -- "Mobile"
	getCurrentDevice(Enum.UserInputType.Gamepad1) -- "Gamepad"
	```

	@within Modules
]=]
local function getCurrentDevice(inputType: Enum.UserInputType)
	for group, patterns in pairs(constants.DeviceInputTypePatterns) do
		for _, pattern in ipairs(patterns) do
			if inputType.Name:match(pattern) then
				return enums.Device[group]
			end
		end
	end

	return enums.Device.Unknown
end

return getCurrentDevice
--[=[
	Debounce a existing function by timeout

	@class throttle
]=]

local require = require(script.Parent.loader).load(script)

local ThrottledFunction = require("ThrottledFunction")
--[[
	Returns the current value of this Tween object.
	The object will be registered as a dependency unless `asDependency` is false.
]]
function class:get(asDependency: boolean?): any
	if asDependency ~= false then
		Dependencies.useDependency(self)
	end
	return self._currentValue
end
--//ENGINE//--
Horsepower = 1500  --{This is how much power your engine block makes ALONE, this does not represent to total horsepower output [IF you have a turbo/SC]}
EngineDisplacement = 2200 --{Engine size in CC's}
EngineType =  "Petrol" --{Petrol, Diesel, Electric]
EngineLocation = "Front" --{Front, Mid, Rear}
ForcedInduction = "Supercharger" --{Natural, Single, Twin, Supercharger} 
InductionPartSize = 1 --{0-5, 1 being small, 5 being large (Decimals accepted, e.g 2.64 turbo size, this is the size of the turbo}
ElectronicallyLimited = false --{Electronically Limit the top speed of your vehicle}
LimitSpeedValue = 236.121 --{Limits top speed of the vehicle [In MPH]}
--- Skill
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://4835590095"

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Z and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Debounce = false
		Tool.Active.Value = "SunaTornado"
		wait(0.1)
		Track1 = Player.Character.Humanoid:LoadAnimation(Animation)
		Track1:Play()
		wait(0.15)
		script.Fire:FireServer(plr)
	local hum =  Player.Character.Humanoid
	for i = 1,30 do
		wait()
		hum.CameraOffset = Vector3.new(
			math.random(-1,1),
			math.random(-1,1),
			math.random(-1,1)
		)
	end
	hum.CameraOffset = Vector3.new(0,0,0)
	    wait(0.15)
		Tool.Active.Value = "None"
		wait(2)
		Debounce = true
	end
end)
--[[Susupension]]
	Tune.SusEnabled		= false		-- 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	= .4		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .4		-- 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	= .4		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .4		-- 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]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--- Add sounds when interacting with a gui element


return function(element, interactType, interactSoundId, interactSoundVolume, enableRandomPitch)
	--- Variables
	interactType = string.lower(interactType)
	interactSoundVolume = interactSoundVolume or 0.15
	enableRandomPitch = enableRandomPitch or false
	--
	local events = {}
	
	--- Events
	if interactType == "mousedown" then
		--- Mouse down
		events[#events + 1] = element.MouseButton1Down:Connect(function()
			_L.Audio.Play(interactSoundId, script, (enableRandomPitch and math.random(95, 105) / 100 or 1), interactSoundVolume * 2)
		end)
		
	elseif interactType == "mouseup" then
		--- Mouse up
		events[#events + 1] = element.MouseButton1Up:Connect(function()
			_L.Audio.Play(interactSoundId, script, (enableRandomPitch and math.random(95, 105) / 100 or 1), interactSoundVolume * 2)
		end)
		
	elseif interactType == "mouseenter" then
		--- Mouse hover over
		events[#events + 1] = element.MouseEnter:Connect(function()
			_L.Audio.Play(interactSoundId, script, (enableRandomPitch and math.random(95, 105) / 100 or 1), interactSoundVolume)
		end)

	elseif interactType == "mouseleave" then
		--- Mouse hover leave
		events[#events + 1] = element.MouseLeave:Connect(function()
			_L.Audio.Play(interactSoundId, script, (enableRandomPitch and math.random(95, 105) / 100 or 1), interactSoundVolume)
		end)
	
	elseif interactType == "mouseclick" then
		--- Mouse click
		events[#events + 1] = element.MouseButton1Click:Connect(function()
			_L.Audio.Play(interactSoundId, script, (enableRandomPitch and math.random(95, 105) / 100 or 1), interactSoundVolume)
		end)
	end
	
	--- Return function to cancel this behavior
	return function()
		for _, event in ipairs(events) do
			event:disconnect()
		end
		events = nil
	end
end
--Place this INSIDE the model. Don't replace the model name or anything.


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


object = script.Parent 


if (object ~= nil) and (object ~= game.Workspace) then 


model = object 





backup = model:clone() -- Make the backup 


waitTime = 60 --Time to wait between regenerations
-- / UIs / --
local CutsceneFrame = CutsceneGui.CutsceneFrame
--Put the used services into variables
local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")
-- @Context Server
-- Given a weapon definition, position, and direction. A projectile will be simulated on all clients. 
-- @param WeaponDefinition weaponDefinition
-- @param Vector3 position
-- @param Vector3 direction
-- @param Player _owner
function ProjectileReplication.ReplicateProjectile(weaponDefinition, position, direction, _owner)
	if RunService:IsServer() then
		--print("Sending visual to all clients",weaponDefinition, position, direction, _owner)
		-- If the server makes the request to replicate a projectile then then this is sent to everyone besides the sender
		RE_CreateProjectile:FireAllClients(weaponDefinition:GetIDName(), position, direction, _owner)
	end
end
-- Parses all folders and their child. Folders will be recursively searched.
---@param folder instance
function Database.ParseFolder(folder)
    local dataRoot = {}
    Database._Parse_R(dataRoot,folder,dataRoot)
    -- Store the data onto the database.
	Database[folder.name] = dataRoot
end
--		print(AnimName .. " * " .. Index .. " [" .. OrigRoll .. "]")
		local Anim = AnimTable[AnimName][Index].Anim

		-- load it to the humanoid; get AnimationTrack
		ToolAnimTrack = Humanoid:LoadAnimation(Anim)
		 
		-- play the animation
		ToolAnimTrack:Play(TransitionTime)
		ToolAnimName = AnimName

		CurrentToolAnimKeyframeHandler = ToolAnimTrack.KeyframeReached:connect(ToolKeyframeReachedFunc)
	end
end

function StopToolAnimations()
	local OldAnim = ToolAnimName

	if CurrentToolAnimKeyframeHandler then
		CurrentToolAnimKeyframeHandler:disconnect()
	end

	ToolAnimName = ""
	if ToolAnimTrack then
		ToolAnimTrack:Stop()
		ToolAnimTrack:Destroy()
		ToolAnimTrack = nil
	end

	return OldAnim
end
--// This method is to be used with the new filter API. This method takes the
--// TextFilterResult objects and converts them into the appropriate string
--// messages for each player.
function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName)
	local messageObj = ShallowCopy(inMessageObj)

	local oldFilterResult = messageObj.FilterResult
	local player = self:GetPlayer()

	local msg = ""
	pcall(function()
		if (messageObj.IsFilterResult) then
			if (player) then
				msg = oldFilterResult:GetChatForUserAsync(player.UserId)
			else
				msg = oldFilterResult:GetNonChatStringForBroadcastAsync()
			end
		else
			msg = oldFilterResult
		end
	end)

	--// Messages of 0 length are the result of two users not being allowed
	--// to chat, or GetChatForUserAsync() failing. In both of these situations,
	--// messages with length of 0 should not be sent.

	if UserFlagRemoveMessageOnTextFilterFailures then
		messageObj.Message = msg
		messageObj.FilterResult = nil
		self:InternalSendFilteredMessage(messageObj, channelName)
	else
		if (#msg > 0) then
			messageObj.Message = msg
			messageObj.FilterResult = nil
			self:InternalSendFilteredMessage(messageObj, channelName)
		end
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self:LazyFire("eReceivedSystemMessage", messageObj, channelName)
		if self.PlayerObj then
			self.EventFolder.OnNewSystemMessage:FireClient(self.PlayerObj, messageObj, channelName)
		end
	end)
	if not success and err then
		print("Error sending internal system message: " ..err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self:LazyFire("eChannelNameColorUpdated", channelName, channelNameColor)
	if self.PlayerObj then
		self.EventFolder.ChannelNameColorUpdated:FireClient(self.PlayerObj, channelName, channelNameColor)
	end
end
-- please do not distribute this plugin and pass it as yours

WheelModel = script.Parent:WaitForChild("Wheels")
rainEffect = script:WaitForChild("RainEffect")
wheels = {}
touchingparts = {}

for i, v in pairs(WheelModel:GetChildren()) do
	if v:IsA("BasePart") then
		table.insert(wheels, v)
		rainEffect:Clone().Parent = v
		table.insert(touchingparts, nil)
	end
end
for i, v in pairs(wheels) do
	v.Touched:connect(function(part)
		touchingparts[i] = part
	end)
end
RunService = game:GetService("RunService")

RunService.Heartbeat:connect(function()
	for i, v in pairs(wheels) do
		local speed = v.Velocity.magnitude
		if speed > 20 then
			if touchingparts[i].Material == Enum.Material.Glass or touchingparts[i].Material == Enum.Material.Ice then
				v.RainEffect.Rate = 5/100 * speed * 10
			else
				v.RainEffect.Rate = 0
			end
		else
			v.RainEffect.Rate = 0
		end
	end
end)
-- Signal types
export type Connection = {
	Disconnect: (self: Connection) -> (),
	Destroy: (self: Connection) -> (),
	Connected: boolean,
}

export type Signal<T...> = {
	Fire: (self: Signal<T...>, T...) -> (),
	FireDeferred: (self: Signal<T...>, T...) -> (),
	Connect: (self: Signal<T...>, fn: (T...) -> ()) -> Connection,
	Once: (self: Signal<T...>, fn: (T...) -> ()) -> Connection,
	DisconnectAll: (self: Signal<T...>) -> (),
	GetConnections: (self: Signal<T...>) -> { Connection },
	Destroy: (self: Signal<T...>) -> (),
	Wait: (self: Signal<T...>) -> T...,
}
--------END STAGE--------
--------CREW--------

game.Workspace.crewview1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.crew2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
game.Workspace.crew3.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CustomScreen.Value)..""
--------------------------------------------------
script.Parent.Values.RPM.Changed:connect(function()
	intach.Rotation = -65 + script.Parent.Values.RPM.Value * 250 / 8000
end)

script.Parent.Values.Velocity.Changed:connect(function(property)
	inspd.Rotation = -30 + (440 / 160) * (math.abs(script.Parent.Values.Velocity.Value.Magnitude*((10/12) * (50/88))))
end)

script.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Values.Gear.Value
	if gearText == 0 then 
		gearText = "N"
		car.Body.Dash.DashSc.G.Gear.Text = "N"
		car.DriveSeat.Filter:FireServer('reverse',false)
	elseif gearText == -1 then
		gearText = "R"
		car.Body.Dash.DashSc.G.Gear.Text = "R"
		car.DriveSeat.Filter:FireServer('reverse',true)
	end
	car.Body.Dash.DashSc.G.Gear.Text = gearText
end)

script.Parent.Values.PBrake.Changed:connect(function()
	dash.PBrake.Visible = script.Parent.Values.PBrake.Value
end)

local car = script.Parent.Car.Value
local Values = script.Parent.Values
local _Tune = require(car["A-Chassis Tune"])


game["Run Service"].Stepped:connect(function()
	local rev = (Values.RPM.Value/_Tune.Redline)
	local MPHScale = (10/12) * (60/88)
	local KPHScale = (10/12) * 1.09728
	local Speed = Values.Velocity.Value.Magnitude
	car.Body.Gauges.Screen.FPGauges.Gauge.RPMFrame.Fill.Size = UDim2.new(rev,0,1,0)
	car.Body.Gauges.Screen.FPGauges.Gauge.Gear.Gear.Text = Values.Gear.Value
	car.Body.Gauges.Screen.FPGauges.Gauge.Speed.MPH.Text = " ".. math.floor(Speed*MPHScale)
	car.Body.Gauges.Screen.FPGauges.Gauge.Speed.KPH.Text = "  ".. math.floor(Speed*KPHScale)
end)
--- Setting Fire ---
local fire = script.Fire
fire.Parent = pellet
fire.Enabled = true
damage = 10


local DebrisService = game:GetService('Debris')

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

function FireScript(human)
	if human.Parent.Torso:FindFirstChild("FIRE")~= nil then
	else
		local FireBurn = script.FIRE:Clone()
		FireBurn.Parent = human.Parent.Torso
		FireBurn.FireDamage.Disabled = false
	end
end

function onTouched(hit)
	if hit and hit.Parent then
		if HitPeople[hit.Parent.Name] then