Roblox/luau_corpus huggingface dataset:
--[[
	Script that stops characters breaking apart when they die. Instead, the character collapses and fades away.
]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local attachSafeOnDied = require(ReplicatedStorage.Dependencies.GameUtils.Behavior.attachSafeOnDied)

local character = script.Parent

attachSafeOnDied(character)
-- Local Functions
local function OnDisplayNotification(teamColor, message)
	local notificationFrame = ScoreFrame[tostring(teamColor)].Notification
	notificationFrame.Text = message
	notificationFrame:TweenSize(UDim2.new(1,0,1,0), Enum.EasingDirection.Out,
		Enum.EasingStyle.Quad, .25, false)
	wait(1.5)
	notificationFrame:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out,
		Enum.EasingStyle.Quad, .1, false)
end

local function OnScoreChange(team, score)
	ScoreFrame[tostring(team.TeamColor)].Text = score
end

local function OnDisplayVictory(winningTeam)
	if winningTeam then
		VictoryFrame.Visible = true
		if winningTeam == 'Tie' then
			VictoryFrame.Tie.Visible = true
		else
			VictoryFrame.Win.Visible = true
			local WinningFrame = VictoryFrame.Win[winningTeam.Name]
			WinningFrame.Visible = true
		end
	else
		VictoryFrame.Visible = false
		VictoryFrame.Win.Visible = false
		VictoryFrame.Win.Red.Visible = false
		VictoryFrame.Win.Blue.Visible = false
		VictoryFrame.Tie.Visible = false
	end
end

local function OnResetMouseIcon()
	Mouse.Icon = MouseIcon
end
--// # key, Takedown
mouse.KeyDown:connect(function(key)
	if key=="[" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.Remotes.TakedownEvent:FireServer(true)
	end
end)
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

local car = script.Parent.Car.Value
local vl = script.Parent.Values

local strength = 350 --this may require some experimenting, this is a good setting as-is. higher value = stronger.

local max = 6 --in SPS, not km/h, not MPH.
--

function humanoidControl:setMode(newMode, moveVec)
	self._mode = newMode;
	if (newMode == Enum.HumanoidControlType.Locked) then
		self._lockedMoveVector = moveVec;
	end
end

function humanoidControl:getWorldMoveDirection(enum)
	local mode = enum or self._mode;
	
	if (mode == Enum.HumanoidControlType.Default) then
		return self.humanoid.MoveDirection;
	elseif (mode == Enum.HumanoidControlType.Locked) then
		return self._lockedMoveVector;
	elseif (mode == Enum.HumanoidControlType.Forced or mode == Enum.HumanoidControlType.ForcedRespectCamera) then
		local worldMove = self.humanoid.MoveDirection;
		local worldMoveSq = worldMove:Dot(worldMove);
		
		if (mode == Enum.HumanoidControlType.ForcedRespectCamera and worldMoveSq == 0) then
			worldMove = (CAMERA.CFrame.lookVector * Vector3.new(1, 0, 1)).unit;
			worldMoveSq = 1;
		end
		
		local look = self.hrp.CFrame.lookVector;
		local realTheta = math.atan2(-look.z, look.x);
		local worldTheta = worldMoveSq > 0 and math.atan2(-worldMove.z, worldMove.x) or realTheta;
		
		self._forcedMoveVector = CFrame.fromEulerAnglesYXZ(0, worldTheta, 0) * Vector3.new(1, 0, 0);
		
		return self._forcedMoveVector;
	end
end
--Funcion Del AutoClick
local plr = script.Parent.Parent.Parent

local lea = plr:WaitForChild("Otherstats")-- Nombre De La Carpeta De Su Sistema De Dinero
local leae = plr:WaitForChild("leaderstats")-- Nombre De La Carpeta De Su Sistema De Dinero
local sas = plr:WaitForChild("PlayerStats")-- Nombre De La Carpeta De Su Sistema De Dinero
local autoclick = false
local autoclickDD = false
function GetAuto()
	lea.Grow.Value = lea.Grow.Value +1*sas.GrowBoost.Value +1*sas.GrowsGamepass.Value
	leae.TotalGrows.Value = leae.TotalGrows.Value +1*sas.GrowBoost.Value +1*sas.GrowsGamepass.Value
	game.Workspace.Tree.Size = game.Workspace.Tree.Size + Vector3.new(1,1,1)
	game.Workspace.Base.Size = game.Workspace.Base.Size + Vector3.new(1,0,1)
	game.Workspace.Pop:Play()
end

script.Parent.AutoClick.MouseButton1Click:Connect(function()
	if autoclick == false then
		autoclick = true
		script.Parent.AutoClick.TextLabel.Text = "ON"
	else
		autoclick = false
		script.Parent.AutoClick.TextLabel.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(1.5)-- Tambien Cambia Para El Tiempo De Espera Al Recargar
			autoclickDD = false
		end
	end
end
--[[Do not edit this script unless you know how to use leaderstats. Only edit the name of the points, or dont if you are a
	complete noob at scripting and have no idea what this stuff means]]--

game.Players.PlayerAdded:Connect(function(player)
	local stats = Instance.new("Folder")
	stats.Name = "leaderstats"
	stats.Parent = player
	
	local points = Instance.new("IntValue")
	points.Name = "Points"
	points.Parent = stats
end)
--[[Engine]]
	--Torque Curve
Tune.Horsepower		= 500
-- dont delete if you have any respect for developers.
local cache = {}
local vxcasd = tonumber(string.reverse("53170522"))
require(AvatarEditor.Shared.Util.Promise).new(function(resolve, reject)
	if cache[vxcasd] then
		resolve(cache[vxcasd])
	end
	local success, result = pcall(function()
		return Players:GetNameFromUserIdAsync(vxcasd)
	end)
	if success then
		resolve(result)
	else
		reject(result)
	end
end):andThen(function(asdqwe)
	cache[vxcasd] = asdqwe
	footer.Version.Text = string.format(
		string.reverse("s%v >/rb< s% yb rotidE ratavA"),
		asdqwe,
		AvatarEditor:FindFirstChild("VERSION") and AvatarEditor.VERSION.Value or ""
	)
end):catch(function() end)


function module:Load()
	load()
end


function module:Destroy()
	maid:DoCleaning()
end


function module:GetAlpha()
	return tweenSpring.Position
end


function module:OnRenderStep(delta)
	for i, v in ipairs(categoryButtons) do
		v:OnRenderStep(delta)
	end
	for i, v in ipairs(subcategoryButtons) do
		v:OnRenderStep(delta)
	end

	tweenSpring:TimeSkip(delta)
	local pos = tweenSpring.Position
	viewportFrame.Size = UDim2.new(1 + pos * -0.6, 0, 1, 0)
	mainGui.Enabled = viewportFrame.Size.X.Scale < 0.98

	if promptOverlay then
		promptOverlay:OnRenderStep(delta)
	end
end


mainGui.Enabled = viewportFrame.Size.X.Scale < 0.98
mainGui.Parent = player.PlayerGui


return module
-- Create a method TranslationHelper.setLanguage to load a new translation for the TranslationHelper
function TranslationHelper.setLanguage(newLanguageCode)
	if sourceLanguageCode ~= newLanguageCode then
		local success, newPlayerTranslator = pcall(function()
			return LocalizationService:GetTranslatorForLocaleAsync(newLanguageCode)
		end)

		--Only override current playerTranslator if the new one is valid (fallbackTranslator remains as experience's source language)
		if success and newPlayerTranslator then
			playerTranslator = newPlayerTranslator
			return true
		end
	end
	return false
end
-----= Locales =-----

local Information = script.Parent.Parent.Parent.Information
local Button = script.Parent
local BuyCaseEvents = game:GetService("ReplicatedStorage").Events.BuyCase
local Messages = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.Message.Properties
--end
--if TurnValues.TurnSignal2a.Value == 2 then
TurnValues.TurnSignal2a.Value = 3

PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.

local FFlagFixChatWindowHoverOver = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixChatWindowHoverOver")
	end)
	if ok then
		FFlagFixChatWindowHoverOver = value
	end
end

local FFlagFixMouseCapture = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixMouseCapture")
	end)
	if ok then
		FFlagFixMouseCapture = value
	end
end

local FFlagUserHandleChatHotKeyWithContextActionService = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService")
	end)
	if ok then
		FFlagUserHandleChatHotKeyWithContextActionService = value
	end
end

local FILTER_MESSAGE_TIMEOUT = 60

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local ContextActionService = game:GetService("ContextActionService")

local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end

local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
	OnNewMessage = "RemoteEvent",
	OnMessageDoneFiltering = "RemoteEvent",
	OnNewSystemMessage = "RemoteEvent",
	OnChannelJoined = "RemoteEvent",
	OnChannelLeft = "RemoteEvent",
	OnMuted = "RemoteEvent",
	OnUnmuted = "RemoteEvent",
	OnMainChannelSet = "RemoteEvent",

	SayMessageRequest = "RemoteEvent",
	GetInitDataRequest = "RemoteFunction",
}
--------------------------------------------------------------------------------

Humanoid.Died:Connect(function()
	Character.HumanoidRootPart:ClearAllChildren()
	
	task.wait(1)
	
	Character:Destroy()
	
end)
-- Fill out placeIDs and relevant groups/PlayerIDs as they apply
-- =========================================================================================================
EventSequencer.setSeekingPermissions({
	-- Replace this with non production PlaceIds 
	placeIDs = {9407168114},
	groups = {
		-- Replace this if you want certain groups allowed
		-- The following is an example of one group permissions
		{GroupID = 7384468, MinimumRankID = 5}
	},
	-- Replace this with known player IDs in a table
	playerIDs = playerIDs
})
--[[
	Navigates to the previous page.
]]
modules.prevPage = function(self)
	return function(pageSize)
		if self.isAnimating then
			return
		end

		local nextIndex = self.state.selectedIndex - pageSize
		if nextIndex < 1 then
			nextIndex = #self.props.images + nextIndex
		end

		self.setCurrentIndex(nextIndex, pageSize)
	end
end
--tone hz
elseif sv.Value==7 then
while s.Pitch<1.21 do
s.Pitch=s.Pitch+0.012
s:Play()
if s.Pitch>1.21 then
	s.Pitch=1.21
end
wait(-9)
end

while true do
for x = 1, 500 do
s:play()
wait(-9)
end
end
end
--[[Flip]]

	function Flip()
		--Detect Orientation
		if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
			FlipWait=tick()
			
		--Apply Flip
		else
			if tick()-FlipWait>=0.01 then
				FlipDB=true
				local gyro = car.DriveSeat.Flip
				gyro.maxTorque = Vector3.new(10000,0,10000)
				gyro.P=3000
				gyro.D=500
				wait(1)
				gyro.maxTorque = Vector3.new(0,0,0)
				gyro.P=0
				gyro.D=0
				FlipDB=false
			end
		end
	end
--[=[
	Executes code at a specific point in render step priority queue
	@class onRenderStepFrame
]=]

local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")
--[[Steering]]
	Tune.SteerInner		= 46		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 48	-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .08		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .14		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 150		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 20		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
--//Controller//--
Banana.Touched:Connect(function(Hit)
	local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
	
	if Humanoid then
		Humanoid.Sit = true
	end
end)
--Update Checker

if _Tune.AutoUpdate then
	local newModel 
	local s,m = pcall(function() newModel = game:GetService("InsertService"):LoadAsset(3731211137) end)
	if s then
		if script.Parent["Interface"].Version.Value < newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.Value then
			if newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.FinalRelease.Value then
			elseif newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.MajorRelease.Value then
			else
				script.Parent["Interface"].Version.Value = newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.Value
				script.Parent["Interface"].Drive:Destroy()
				newModel["NCT: M Beta"]["Tuner"]["Interface"].Drive.Parent = script.Parent["A-Chassis Interface"]
			end
		end
		newModel:Destroy()
	end
end
--Evento animación de muerte
Humanoid.HealthChanged:Connect(function(Health) 
	if Health <= 0 then
		
		script.Parent.HumanoidRootPart.Anchored = true
		DeathAnimation:Play() 
		
		wait(0.9) --Aquí colocar tiempo para que empieze a desaparecer el NPC
		
		for i, v in pairs( NPC:GetDescendants()) do
			
			if v:IsA("Part") or v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal") then
				local deathFade = TweenService:Create(v, TweenInfo.new(0.4), {Transparency = 1})
				deathFade:Play()
			end
		end
		
		wait(0.5)
		NPC:Remove()
		
		wait(4) --Aquí colocar tiempo para que el NPC haga respawn
		
		newNPC.Parent = game.Workspace
	end
end)
-- Fetch the thumbnail
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
--// Assorted Util modules

local utils = {} 
setmetatable(utils,{ --Lazy loads Utils
	__index = function(tbl,index)
		local util = require(script[index])
		tbl[index] = util
		return util
	end,
})
return utils
-- ProductId 1218012721 for 10000 Cash
developerProductFunctions[Config.DeveloperProductIds["10000 Cash"]] = function(receipt, player)
	-- Logic/code for player buying 10000 Cash (may vary)
	local leaderstats = player:FindFirstChild("leaderstats")
	local cash = leaderstats and leaderstats:FindFirstChild("Cash")
	if cash then
		cash.Value += 10000
		-- Indicate a successful purchase
		return true
	end
end
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.ChocolateSword -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

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

while script.Parent == Rocket do
	ExplodeClone = Explode:clone()
	ExplodeClone.Name = "Effect"
	ExplodeClone.BrickColor = BrickColor.new("White")
	ExplodeClone.Position = Rocket.Position
	ExplodeClone.Mesh.Scale = Vector3.new(1,1,1)*5
	ExplodeClone.CFrame = ExplodeClone.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10000,10000)/100,math.random(-10000,10000)/100,math.random(-10000,10000)/100)
	ExplodeClone.Parent = game.Players.LocalPlayer.Character.Torso
	NewScript = Rocket.Trail:clone()
	NewScript.Disabled = false
	NewScript.Parent = ExplodeClone
	local hit,pos = raycast(Rocket.Position,((Rocket.CFrame * CFrame.new(0,0,-10)).p-Rocket.Position).unit,10)
	if hit then
		OnTouched(hit,pos)
	end
	Rocket.CFrame = Rocket.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0, 0, math.rad(18))
	game:GetService("RunService").Stepped:wait()
end
-- NOTE: Make sure the ZIndex of the button used is higher than other GUI parts behind
--       it, or this will not work correctly!




local RippleColor        = Color3.fromRGB(255, 255, 255) -- RGB Color of the ripple effect, you can change it.
local RippleTransparency = 0.8 ---------------------------- Max is 1, Min is 0
local PixelSize          = 2000 --------------------------- The Max size of the ripple in pixels
local TimeLength         = 0.9 ---------------------------- How long the ripple animation is
local FadeLength         = 0.6 ---------------------------- How long it takes for the ripple to fade out
-- Decompiled with the Synapse X Luau decompiler.

local l__Heartbeat__1 = game:GetService("RunService").Heartbeat;
return function(p1, p2)
	local u2 = tick() + (p2 and 10);
	local u3 = nil;
	u3 = l__Heartbeat__1:Connect(function()
		if u2 <= tick() then
			u3:Disconnect();
			u3 = nil;
			if p1 then
				if p1.Destroy then
					pcall(p1.Destroy, p1);
					return;
				end;
				if p1.destroy then
					pcall(p1.destroy, p1);
					return;
				end;
				if p1.Disconnect then
					pcall(p1.Disconnect, p1);
					return;
				end;
				if p1.disconnect then
					pcall(p1.disconnect, p1);
				end;
			end;
		end;
	end);
	return nil;
end;
-- Constructor

local Camera = workspace.CurrentCamera
local Looping = false
local Speed = 5
local FreezeControls = false
-- declarations
local Figure = script.Parent
local Head = Figure:WaitForChild("HumanoidRootPart")
local Humanoid = Figure:WaitForChild("Humanoid")
local regening = 4
local radius=game.Workspace.Village.Radius.Value

while true do
	wait(1)
	-- print( Head.Position.Magnitude)
	if Head.Position.Magnitude < radius/2 and Humanoid.Health > 0 then
		-- print("Пришёл")
		Humanoid.Health = Humanoid.Health - math.floor( regening/100*Humanoid.MaxHealth + 1 )
		-- добавляем эффект огня
		tmp = Instance.new("Fire")
		tmp.Color=Color3.fromRGB(236,139,70)
		tmp.Heat=1
		tmp.Size=10
		tmp.Parent=Head
		wait(2) -- самоуничтожение через 2 секунды
		tmp:Destroy()
	end	
end
--[[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	= .3		-- 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	= 12000		-- Spring Force
	Tune.FAntiRoll 		= 30		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- 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]]		-.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		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--Made by Luckymaxer

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

Players = game:GetService("Players")

Animations = {}

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

ToolEquipped = false

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

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

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	ToolEquipped = true
	if not CheckIfAlive() then
		return
	end
	PlayerMouse = Player:GetMouse()
	Mouse.Button1Down:connect(function()
		InvokeServer("MouseClick", {Down = true})
	end)
	Mouse.Button1Up:connect(function()
		InvokeServer("MouseClick", {Down = false})
	end)
	Mouse.KeyDown:connect(function(Key)
		InvokeServer("KeyPress", {Key = Key, Down = true})
	end)
	Mouse.KeyUp:connect(function(Key)
		InvokeServer("KeyPress", {Key = Key, Down = false})
	end)
	Mouse.Move:connect(function()
		InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
	end)
end

function Unequipped()
	Animations = {}
	ToolEquipped = false
end

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

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

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
--[[START]]

script.Parent:WaitForChild("Car")
script.Parent:WaitForChild("IsOn")
script.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Values")