Pinkstack/roblox-luau-corpus-text huggingface dataset:
----------------------------------------DONT EDIT BELOW------------------------------------------------------------------------------


Color=BrickColor.new(TeamColor)
on=false
s=script.Parent
ss=script.Parent:clone()
s.BrickColor=Color
function Check(hit) if on then return end
if hit==nil then return end
local player=game.Players:FindFirstChild(hit.Parent.Name)
if player==nil then return end
on=true
	if player.TeamColor==Color then
	s.Transparency=0.6
	s.CanCollide=false
	wait(Time)
	s.Transparency=ss.Transparency
	s.CanCollide=true
	else
	local h=player.Character:FindFirstChild("Humanoid")
	local t=player.Character:FindFirstChild("Torso")
	if t==nil or h==nil then s.CanCollide=true s.Transparency=ss.Transparency on=false return end
	if AntiHack==1 then
	h.Sit=true
	t.Velocity=t.CFrame:inverse().lookVector*80
	elseif AntiHack==2 then
	h.Health=0
	elseif AntiHack==0 then
	else hit.Parent=nil
	end
	end
on=false
end

s.Touched:connect(Check)
---Model By: Midnight Productions



location = script.Parent.Parent.Parent
regen = script.Parent.Parent
save = regen:clone()

function onClicked()
	regen:remove()
    wait(.2)
	local back = save:clone()
	back.Parent = location
	back:MakeJoints()
end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Compiled with roblox-ts v1.3.3
--[[
	*
	* Set a variable's type to a new case of the same variant.
	* @param obj object of concern.
	* @param _type new type tag. Restricted to keys of the variant.
	* @param _typeKey discriminant key.
]]


local function cast(obj, _type, _typeKey)
	return obj
end
return {
	cast = cast,
}
--- Recalculate the window height


function Window:UpdateWindowHeight()
	local windowHeight = Gui.UIListLayout.AbsoluteContentSize.Y
		+ Gui.UIPadding.PaddingTop.Offset
		+ Gui.UIPadding.PaddingBottom.Offset
	Gui.Size = UDim2.new(Gui.Size.X.Scale, Gui.Size.X.Offset, 0, math.clamp(windowHeight, 0, WINDOW_MAX_HEIGHT))
	Gui.CanvasPosition = Vector2.new(0, windowHeight)
end
--Don't worry about the rest of the code, except for line 25.


game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "Skins"
local Cash = Instance.new("StringValue",leader)
Cash.Name = stat
Cash.Value = ds:GetAsync(player.UserId) or startamount
ds:SetAsync(player.UserId, Cash.Value)
Cash.Changed:connect(function()
ds:SetAsync(player.UserId, Cash.Value)
end)
end)

game.Players.PlayerRemoving:connect(function(player)
	ds:SetAsync(player.UserId, player.Skins.Equipped.Value) --Change "Points" to the name of your leaderstat.
end)
-- made by Weeve. for all of you lamo scripters out there, can you at least leave my name here?
-- don't edit anything here


seat = script.Parent

function onChildAdded(part)
	if (part.className == "Weld") then
		while true do
local			welde = seat:FindFirstChild("SeatWeld")

			if (welde ~= nil) then
local			sitted = welde.Part1.Parent
			end

			if (sitted.Name ~= script.Parent.Owner.Value) then
				if (script.Parent.Owner.Value == "NoOne") then
					script.Parent.Owner.Value = sitted.Name
					print ("sitted steal")
				else
					print ("stolen!!")
local					shipstealer = game.Workspace:FindFirstChild(sitted.Name)
					if (shipstealer ~= nil) then
						shipstealer.Humanoid.Jump=true
					end
				end
			end


			wait(0.2)

			if (welde == nil) then
				print("BreakLoop")
				script.Parent.Owner.Value = "NoOne"
			break end
		end
	end
end
----------------------------------------------------------------------------------------------------------------


function GunUp()
Holstered = false
Tool.Enabled = true
torso = Tool.Parent:FindFirstChild("Torso")
if torso ~= nil then
torso.weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(10), math.rad(-90))
torso.weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
end
end

function GunDown()
Holstered = true
Tool.Enabled = false -- You don't want to be shooting if your not aiming
torso = Tool.Parent:FindFirstChild("Torso")
if torso ~= nil then
torso.weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(280), math.rad(-10), math.rad(-80))
torso.weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-70), math.rad(-25), math.rad(0))
end
end
--//Server Animations


	RightHighReady = CFrame.new(-1, -1, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0));
	LeftHighReady = CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15));

	RightLowReady = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
	LeftLowReady = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));

	RightPatrol = CFrame.new(-1, -.35, -1.5) * CFrame.Angles(math.rad(-80), math.rad(-80), math.rad(0));
	LeftPatrol = CFrame.new(1,1.25,-.75) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25));

	RightAim = CFrame.new(-.575, 0.1, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftAim = CFrame.new(1.4,0.25,-1.45) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-25));
	
	RightSprint = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
	LeftSprint = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));

	ShootPos = CFrame.new(0,0,.25);
	
}

return module
--!strict


local BloxbizSDK = script.Parent.Parent.Parent.Parent

local UtilsStorage = BloxbizSDK:FindFirstChild("Utils")
local Fusion = require(UtilsStorage:WaitForChild("Fusion"))

return function(radius: number?): Instance
	return Fusion.New("UICorner")({
		CornerRadius = UDim.new(0, radius or 16),
	})
end
-- When a player with the game pass touches the door, teleport them to the other side


local function OnTouched(otherPart)
	if otherPart and otherPart.Parent and otherPart.Parent:FindFirstChild('Humanoid') then
		local player = PlayersService:GetPlayerFromCharacter(otherPart.Parent)
		if player and not JustTouched[player] then
			JustTouched[player] = time()
			if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
				TeleportToOtherSide(player.Character, otherPart)
			end
		end
	end
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 500		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 4.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--First build your Gun, make sure all the parts and Non-Colliding and Not Anchored.
--Second put these parts inside the Tool (Call one of the parts 'Handle' and the rest 'Part'
--Lastly, make/get your gun script and test it out! 



local prev 
local parts = script.Parent:GetChildren() 

for i = 1,#parts do 
	if (parts[i].className == "Part") or (parts[i].className == "VehicleSeat") then 
		if (prev ~= nil)then 
			local weld = Instance.new("Weld") 
			weld.Part0 = prev 
			weld.Part1 = parts[i] 
			weld.C0 = prev.CFrame:inverse() 
			weld.C1 = parts[i].CFrame:inverse() 
			weld.Parent = prev 
		end 
		prev = parts[i] 
	end 
end
---SG Is  Here---
---Please Dont Change Anything Can Dont Work If You Change--



local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local coins = stats:WaitForChild("Clicks")
local text = script.Parent

text.Text = "Clicks: "..coins.Value
coins:GetPropertyChangedSignal("Value"):Connect(function()
	text.Text = "Clicks: "..coins.Value
end)
--[[
	Calls a callback on `finally` with specific arguments.
]]


function Promise.prototype:finallyCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finallyCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end)
end
Promise.prototype.FinallyCall = Promise.prototype.finallyCall
--[[
	
	
	[ Note: Make sure to invoke these remotes using :Invoke(), and also invoke them from the SERVER, not from the client. ]
	
	 - GiveItems [instance Player] [string Item name] (optional number amount)
	 - SetTicks [number Ticks]  --  Changes time of day
	 
	 - Gamemode does not work yet.
		
		
]]


return nil
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 330   	--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 9000		--		Use sliders to manipulate values
	Tune.Redline		= 9000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5600
	Tune.PeakSharpness	= 25
	Tune.CurveMult		= 0.55
	
	--Incline Compensation
	Tune.InclineComp	= 1.3			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--------


Thread:Spawn(function()
	while true do
		for Index, Object in ipairs(ActiveHitboxes) do
			if Object.deleted then
				Handler:remove(Object.object)
			else
				for _, Point in ipairs(Object.points) do
					if not Object.active then
						Point.LastPosition = nil
					else
						local rayStart, rayDir, RelativePointToWorld, debugPart = Point.solver:solve(Point, game:GetService("ReplicatedStorage"):WaitForChild("ClientSettings").Debug.Value)

						local function castFunction(rayStart, rayDir, params)
							local resultOfCast = workspace:Raycast(rayStart, rayDir, params)

							if resultOfCast then
								local hitInstance = resultOfCast.Instance

								if hitInstance.Parent:IsA("Accoutrement") then
									table.insert(params.FilterDescendantsInstances, hitInstance)
									resultOfCast = nil
								end
							end

							return resultOfCast
						end

						local raycastResult = castFunction(rayStart, rayDir, Object.raycastParams)
						Point.solver:lastPosition(Point, RelativePointToWorld)

						if raycastResult then
							local hitPart = raycastResult.Instance
							local findModel = not Object.partMode and hitPart:FindFirstAncestorOfClass("Model")
							local humanoid = findModel and findModel:FindFirstChildOfClass("Humanoid")
							local target = humanoid or (Object.partMode and hitPart)

							if target and not Object.targetsHit[target] then
								Object.targetsHit[target] = true
								
								if debugPart ~= nil and typeof(debugPart) == "Instance" then
									debugPart.Color = Color3.fromRGB(85, 255, 0)
								end
								
								Object.OnHit:Fire(hitPart, humanoid, raycastResult, Point.group)
							end
						end

						if Object.endTime > 0 then
							if Object.endTime <= clock() then
								Object.endTime = 0
								Object:HitStop()
							end
						end

						Object.OnUpdate:Fire(Point.LastPosition)
					end
				end
			end
		end
		
		Thread:Wait(0.028)
	end
end)

return Handler
--// Bullet Physics


	BulletPhysics = Vector3.new(0,58,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 1200; -- Bullet Speed
	BulletSpread = 0; -- How much spread the bullet has
	
	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds
	
	BulletDecay = 120; -- How far the bullet travels before slowing down and being deleted (BUGGY)
----------------------------------------------------------------------------------------------------
------------------=[ Status UI ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,EnableStatusUI 	= true				--- Don't disabled it...
	,RunWalkSpeed 		= 18
	,NormalWalkSpeed 	= 12
	,SlowPaceWalkSpeed 	= 6	
	,CrouchWalkSpeed 	= 6
	,ProneWalksSpeed 	= 3
	
	,InjuredWalksSpeed 		= 8
	,InjuredCrouchWalkSpeed = 4

	,EnableHunger = false				--- Hunger and Thirst system 		(Removed)
	,HungerWaitTime = 25

	,CanDrown = true 					--- Glub glub glub *ded*
	
	,EnableStamina = false 				--- Weapon Sway based on stamina	(Unused)
	,RunValue = 1						--- Stamina consumption
	,StandRecover = .25					--- Stamina recovery while stading
	,CrouchRecover = .5					--- Stamina recovery while crouching
	,ProneRecover = 1					--- Stamina recovery while lying

	,EnableGPS = false					--- GPS shows your allies around you
	,GPSdistance = 150

	,InteractionMenuKey = Enum.KeyCode.LeftAlt
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	Tune.LegacySusEn	= true		-- Sets whether suspension is enabled for Legacy Physics (Same values may vary in tune)
	
	--Front Suspension
	Tune.FSusStiffness	= 25000		-- Spring Force
	Tune.FSusDamping	= 400		-- Spring Dampening
	Tune.FAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 1.9		-- Resting Suspension length (in studs)
	Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusStiffness	= 20000		-- Spring Force
	Tune.RSusDamping	= 400		-- Spring Dampening
	Tune.RAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.RSusLength		= 2.1		-- Resting Suspension length (in studs)
	Tune.RPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
	
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

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

    Connects the events for item addition/removal in the given store.

    The `selector` is a function that takes the store's state as an argument and
	returns the items table from it.

    Returns a Rodux Signal class. This has the same API as RBXScriptSignal but
    lowercase. For example:

    ```lua
    local store = Rodux.Store.new(reducer)
    local conn = itemEvents.connect(store)

    conn:disconnect()
    ```
]]


function itemEvents.connect(store, selector: (table) -> itemInfo.State)
	return store.changed:connect(function(newState: table, oldState: table)
		local oldItemInfo = selector(oldState)
		local newItemInfo = selector(newState)
		if oldItemInfo == newItemInfo then
			return
		end

		for newId, newInfo in pairs(newItemInfo) do
			if not oldItemInfo[newId] then
				-- IDs are converted to number for consistency with the addItemAsync API
				itemEvents.itemAdded:Fire(tonumber(newId), newInfo)
			end
		end

		for oldId, _ in pairs(oldItemInfo) do
			if not newItemInfo[oldId] then
				itemEvents.itemRemoved:Fire(tonumber(oldId))
			end
		end
	end)
end

return itemEvents
--// F key, Horn


uis.InputEnded:connect(function(input)
	if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then 
		script.Parent.Parent.Horn.TextTransparency = 0.8
		veh.Lightbar.middle.Airhorn:Stop()
		veh.Lightbar.middle.Wail.Volume = 1
		veh.Lightbar.middle.Yelp.Volume = 1
		veh.Lightbar.middle.Priority.Volume = 1
		script.Parent.Parent.MBOV.Visible = true
		script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)

uis.InputBegan:connect(function(input)
	if input.Keycode==Enum.KeyCode.LeftBracket then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.TakedownEvent:FireServer(true)
	end
end)

uis.InputBegan:connect(function(input)
	if input.KeyCode==Enum.KeyCode.J or input.KeyCode==Enum.KeyCode.DPadUp then 
		veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
    end
end)
--[=[
	Takes in an observable of brios and returns an observable of the inner values that will also output
	nil if there is no other value for the brio.

	@param emitOnDeathValue U
	@return (source: Observable<Brio<T> | T>) -> Observable<T | U>
]=]


function RxBrioUtils.emitOnDeath(emitOnDeathValue)
	return Rx.switchMap(RxBrioUtils.mapBrioToEmitOnDeathObservable(emitOnDeathValue));
end
-- Write function setters: (Calling outside a write function will throw an error)



function Replica:SetValue(path, value)
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local path_array = (type(path) == "string") and StringPathToArray(path) or path
	ReplicaSetValue(self.Id, path_array, value)
end

function Replica:SetValues(path, values)
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local path_array = (type(path) == "string") and StringPathToArray(path) or path
	ReplicaSetValues(self.Id, path_array, values)
end

function Replica:ArrayInsert(path, value) --> new_index
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local path_array = (type(path) == "string") and StringPathToArray(path) or path
	return ReplicaArrayInsert(self.Id, path_array, value)
end

function Replica:ArraySet(path, index, value)
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local path_array = (type(path) == "string") and StringPathToArray(path) or path
	ReplicaArraySet(self.Id, path_array, index, value)
end

function Replica:ArrayRemove(path, index) --> removed_value
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local path_array = (type(path) == "string") and StringPathToArray(path) or path
	return ReplicaArrayRemove(self.Id, path_array, index)
end

function Replica:Write(function_name, ...) --> return_params...
	if WriteFunctionFlag == false then
		error(SETTINGS.SetterError)
	end
	local func_id = self._write_lib_dictionary[function_name]
	local return_params = table.pack(self._write_lib[func_id](self, ...))
	-- Signaling listeners:
	local listeners = self._function_listeners[func_id]
	if listeners ~= nil then
		for _, listener in ipairs(listeners) do
			listener(...)
		end
	end
	return table.unpack(return_params)
end
--made by Bertox
--lul


local ts = game:GetService("TweenService")
local fadeDRL = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local fadeDRL2 = TweenInfo.new(4, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local goal = {}
local goal2 = {}
local F = {}
local car = script.Parent.Parent.Parent.Parent

 script.Parent.Parent.Parent.Parent.Electrics.Changed:connect(function()
	if script.Parent.Parent.Parent.Parent.Electrics.Value == true then
		drlFade(true)
	else
		drlFade(false)
	end
end)

function drlFade(bool)
		if bool then
			goal2.Transparency = 0.2
			local a = ts:Create(car.Body.DRLs.DRL, fadeDRL, goal2)
			a:Play()
		else
			goal2.Transparency = 1
			local a = ts:Create(car.Body.DRLs.DRL, fadeDRL, goal2)
			a:Play()	
		end
	end

F.drlFade = function(bool)
	drlFade(bool)
end
-------------------------------------------------------------------------



local function FlashRed(object)
	local origColor = object.BrickColor
	local redColor = BrickColor.new("Really red")
	local start = tick()
	local duration = 4
	spawn(function()
		while object and tick() - start < duration do
			object.BrickColor = origColor
			wait(0.13)
			if object then
				object.BrickColor = redColor
			end
			wait(0.13)
		end
	end)
end
--Balance Brick


local bal = Instance.new("Part",bike.Body)
bal.Anchored = true
bal.CanCollide = false
if _Tune.BalVisible or _Tune.Debug then bal.Transparency = .75 else bal.Transparency = 1 end
bal.Name = "bal"
bal.Position = (fWheel.CFrame.p+rWheel.CFrame.p)/2
bal.Orientation = fWheel.Orientation
bal.CFrame = bal.CFrame - (Vector3.new((rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2,(rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2,(rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2)*bal.CFrame.upVector)
bal.Size = Vector3.new(.05,.05,.05)
--back motor



script.Parent.Wheels.boggieF.motb.HingeConstraint.AngularVelocity = speed
script.Parent.Wheels.boggieF.motb.HingeConstraint2.AngularVelocity = -speed
script.Parent.Wheels.boggieF.motb.HingeConstraint.MotorMaxTorque = RPM
script.Parent.Wheels.boggieF.motb.HingeConstraint2.MotorMaxTorque = RPM
--StarterPlayerScripts



local plr = game:GetService("Players").LocalPlayer
game:GetService("RunService").Heartbeat:Connect(function()
	plr.Character:WaitForChild("Humanoid").CameraOffset = Vector3.new(plr.Character:WaitForChild("Humanoid").CameraOffset.X,plr.Character:WaitForChild("Humanoid").CameraOffset.Y,  -1)--Edit Only The Last Number Value
end)
--local bodyPosition = Instance.new("BodyPosition", car.Chassis)
--bodyPosition.MaxForce = Vector3.new()
--local bodyGyro = Instance.new("BodyGyro", car.Chassis)
--bodyGyro.MaxTorque = Vector3.new()



local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude
	
	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end
	
	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.Event.OnServerEvent:Connect(function(Player)
	if Player and Player.Character then
		if (Player.Character.HumanoidRootPart.Position-car.DriveSeat.Position).magnitude <= car.Configurations.Range.Value then
			if not HasDriver then
				car.DriveSeat:Sit(Player.Character.Humanoid)
			end
		end
	end
end)

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			car.EngineBlock.Running.Pitch = 1
			car.EngineBlock.Running:Play()
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				HasDriver = true
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		else
			HasDriver = false
			car.EngineBlock.Running:Stop()
		end
	end
end)