Pinkstack/roblox-luau-corpus-text huggingface dataset:
----- NO EDITING BELOW -----


local weldedParts = {}
table.insert(weldedParts,mainPart)

function Weld(x, y)
	weld = Instance.new("Weld") 
	weld.Part0 = x
	weld.Part1 = y
	local CJ = CFrame.new(x.Position) 
	weld.C0 = x.CFrame:inverse() * CJ  
	weld.C1 = y.CFrame:inverse() * CJ  
	weld.Parent = x	
	table.insert(weldedParts,y)
end

function WeldRec(instance)
	local childs = instance:GetDescendants()
	for _,v in pairs(childs) do
		if v:IsA("BasePart") then
			Weld(mainPart, v)
		end
		WeldRec(v)
	end	
end

WeldRec(P)
--[[
	Unpacks an animatable type into an array of numbers.
	If the type is not animatable, an empty array will be returned.

	FIXME: This function uses a lot of redefinitions to suppress false positives
	from the Luau typechecker - ideally these wouldn't be required

	FUTURE: When Luau supports singleton types, those could be used in
	conjunction with intersection types to make this function fully statically
	type checkable.
]]



local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local Oklab = require(Package.Colour.Oklab)

local function unpackType(value: any, typeString: string): {number}
	if typeString == "number" then
		local value = value :: number
		return {value}

	elseif typeString == "CFrame" then
		-- FUTURE: is there a better way of doing this? doing distance
		-- calculations on `angle` may be incorrect
		local axis, angle = value:ToAxisAngle()
		return {value.X, value.Y, value.Z, axis.X, axis.Y, axis.Z, angle}

	elseif typeString == "Color3" then
		local lab = Oklab.to(value)
		return {lab.X, lab.Y, lab.Z}

	elseif typeString == "ColorSequenceKeypoint" then
		local lab = Oklab.to(value.Value)
		return {lab.X, lab.Y, lab.Z, value.Time}

	elseif typeString == "DateTime" then
		return {value.UnixTimestampMillis}

	elseif typeString == "NumberRange" then
		return {value.Min, value.Max}

	elseif typeString == "NumberSequenceKeypoint" then
		return {value.Value, value.Time, value.Envelope}

	elseif typeString == "PhysicalProperties" then
		return {value.Density, value.Friction, value.Elasticity, value.FrictionWeight, value.ElasticityWeight}

	elseif typeString == "Ray" then
		return {value.Origin.X, value.Origin.Y, value.Origin.Z, value.Direction.X, value.Direction.Y, value.Direction.Z}

	elseif typeString == "Rect" then
		return {value.Min.X, value.Min.Y, value.Max.X, value.Max.Y}

	elseif typeString == "Region3" then
		-- FUTURE: support rotated Region3s if/when they become constructable
		return {
			value.CFrame.X, value.CFrame.Y, value.CFrame.Z,
			value.Size.X, value.Size.Y, value.Size.Z
		}

	elseif typeString == "Region3int16" then
		return {value.Min.X, value.Min.Y, value.Min.Z, value.Max.X, value.Max.Y, value.Max.Z}

	elseif typeString == "UDim" then
		return {value.Scale, value.Offset}

	elseif typeString == "UDim2" then
		return {value.X.Scale, value.X.Offset, value.Y.Scale, value.Y.Offset}

	elseif typeString == "Vector2" then
		return {value.X, value.Y}

	elseif typeString == "Vector2int16" then
		return {value.X, value.Y}

	elseif typeString == "Vector3" then
		return {value.X, value.Y, value.Z}

	elseif typeString == "Vector3int16" then
		return {value.X, value.Y, value.Z}
	else
		return {}
	end
end

return unpackType
--!strict


local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local GameSettings = UserSettings():GetService("UserGameSettings")

local LocalPlayer = Players.LocalPlayer
if not LocalPlayer then
	Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	LocalPlayer = Players.LocalPlayer
end

local Mouse = LocalPlayer:GetMouse()

local Input = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))

local lastTogglePan = false
local lastTogglePanChange = tick()

local CROSS_MOUSE_ICON = "rbxasset://textures/Cursors/CrossMouseIcon.png"

local lockStateDirty = false
local wasTogglePanOnTheLastTimeYouWentIntoFirstPerson = false
local lastFirstPerson = false

CameraUI.setCameraModeToastEnabled(false)

return function(isFirstPerson: boolean)
	local togglePan = Input.getTogglePan()
	local toastTimeout = 3

	if isFirstPerson and togglePan ~= lastTogglePan then
		lockStateDirty = true
	end

	if lastTogglePan ~= togglePan or tick() - lastTogglePanChange > toastTimeout then
		local doShow = togglePan and tick() - lastTogglePanChange < toastTimeout

		CameraUI.setCameraModeToastOpen(doShow)

		if togglePan then
			lockStateDirty = false
		end
		lastTogglePanChange = tick()
		lastTogglePan = togglePan
	end

	if isFirstPerson ~= lastFirstPerson then
		if isFirstPerson then
			wasTogglePanOnTheLastTimeYouWentIntoFirstPerson = Input.getTogglePan()
			Input.setTogglePan(true)
		elseif not lockStateDirty then
			Input.setTogglePan(wasTogglePanOnTheLastTimeYouWentIntoFirstPerson)
		end
	end

	if isFirstPerson then
		if Input.getTogglePan() then
			Mouse.Icon = CROSS_MOUSE_ICON
			UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
			GameSettings.RotationType = Enum.RotationType.CameraRelative
		else
			Mouse.Icon = ""
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
			GameSettings.RotationType = Enum.RotationType.CameraRelative
		end

	elseif Input.getTogglePan() then
		Mouse.Icon = CROSS_MOUSE_ICON
		UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
		GameSettings.RotationType = Enum.RotationType.MovementRelative

	elseif Input.getHoldPan() then
		Mouse.Icon = ""
		UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
		GameSettings.RotationType = Enum.RotationType.MovementRelative

	else
		Mouse.Icon = ""
		UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		GameSettings.RotationType = Enum.RotationType.MovementRelative
	end

	lastFirstPerson = isFirstPerson
end
--[ FUNCTIONS ]--



game.Players.PlayerAdded:Connect(function(player) -- When Player Join
	player.CharacterAdded:Connect(function(chr) -- Grabs Player Character
		player.Chatted:Connect(function(msg) -- When Player Chats

			-- IF start --

			if msg:sub(1, Command:len()):lower() == Command:lower() then -- if msg is /e headless then
				player.Character.Head.Transparency = 1 -- makes head transparent
				player.Character.Head.face.Transparency = 1 -- makes face transparent
			else
				if player.Character.Head.Transparency == 1 then -- if head is transparent
					if msg:sub(1, LeaveCommand:len()):lower() == LeaveCommand:lower() then -- and if msg is /e unheadless then
						player.Character.Head.Transparency = 0 -- makes head untransparent
						player.Character.Head.face.Transparency = 0 -- makes face untransparent
					end
				end
			end

			-- IF end --

		end)
	end)
end)
--Main Control------------------------------------------------------------------------


Red = script.Parent.Red.Lamp.ImageLabel
Yellow = script.Parent.Yellow.Lamp.ImageLabel
Green = script.Parent.Green.Lamp.ImageLabel
DRed = script.Parent.Red.DynamicLight
DYellow = script.Parent.Yellow.DynamicLight
DGreen = script.Parent.Green.DynamicLight
function Active()
	if Signal.Value == 0 then
		repeat 
		Yellow.ImageTransparency = Yellow.ImageTransparency + 0.175
		Red.ImageTransparency = Red.ImageTransparency + 0.175
		Green.ImageTransparency = Green.ImageTransparency + 0.175
		DYellow.Brightness = DYellow.Brightness - 0.35
		DRed.Brightness = DRed.Brightness - 0.35
		DGreen.Brightness = DGreen.Brightness - 0.35
		wait()
		if Signal.Value ~= 0 then break end
		until 
		Red.ImageTransparency == 1
		and
		Yellow.ImageTransparency == 1
		and
		Green.ImageTransparency == 1
		and
		DYellow.Brightness <= 0
		and
		DGreen.Brightness <= 0
		and
		DRed.Brightness <= 0
	elseif Signal.Value == 1 then
		repeat 
		Yellow.ImageTransparency = Yellow.ImageTransparency + 0.175
		Red.ImageTransparency = Red.ImageTransparency + 0.175
		Green.ImageTransparency = Green.ImageTransparency - 0.125
		DYellow.Brightness = DYellow.Brightness - 0.35
		DRed.Brightness = DRed.Brightness - 0.35
		DGreen.Brightness = DGreen.Brightness + 0.25
		wait()
		if Signal.Value ~= 1 then break end
		until 
		Red.ImageTransparency == 1
		and
		Yellow.ImageTransparency == 1
		and
		Green.ImageTransparency == 0
		and
		DYellow.Brightness <= 0
		and
		DGreen.Brightness >= 2
		and
		DRed.Brightness == 0
	elseif Signal.Value == 2 then
		repeat 
		Yellow.ImageTransparency = Yellow.ImageTransparency - 0.125
		Red.ImageTransparency = Red.ImageTransparency + 0.175
		Green.ImageTransparency = Green.ImageTransparency + 0.175
		DYellow.Brightness = DYellow.Brightness + 0.25
		DRed.Brightness = DRed.Brightness - 0.35
		DGreen.Brightness = DGreen.Brightness - 0.35
		wait()
		if Signal.Value ~= 2 then break end
		until 
		Red.ImageTransparency == 1
		and
		Yellow.ImageTransparency == 0
		and
		Green.ImageTransparency == 1
		and
		DYellow.Brightness >= 2
		and
		DGreen.Brightness <= 0
		and
		DRed.Brightness <= 0
	elseif Signal.Value == 3 then
		repeat 
		Yellow.ImageTransparency = Yellow.ImageTransparency + 0.175
		Red.ImageTransparency = Red.ImageTransparency - 0.125
		Green.ImageTransparency = Green.ImageTransparency + 0.175
		DYellow.Brightness = DYellow.Brightness - 0.35
		DRed.Brightness = DRed.Brightness + 0.25
		DGreen.Brightness = DGreen.Brightness - 0.35
		wait()
		if Signal.Value ~= 3 then break end
		until 
		Red.ImageTransparency == 0
		and
		Yellow.ImageTransparency == 1
		and
		Green.ImageTransparency == 1
		and
		DYellow.Brightness <= 0
		and
		DGreen.Brightness <= 0
		and
		DRed.Brightness >= 2
	end
end
Signal.Changed:connect(Active)
-- Roblox NPC sound script



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

local SOUND_DATA = {
	Climbing = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
		Looped = true,
	},
	Died = {
		SoundId = "rbxasset://sounds/uuhhh.mp3",
	},
	FreeFalling = {
		SoundId = "rbxasset://sounds/action_falling.mp3",
		Looped = true,
	},
	GettingUp = {
		SoundId = "rbxasset://sounds/action_get_up.mp3",
	},
	Jumping = {
		SoundId = "rbxasset://sounds/action_jump.mp3",
	},
	Landing = {
		SoundId = "rbxasset://sounds/action_jump_land.mp3",
	},
	Running = {
		SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
		Looped = true,
		Pitch = 1.85,
	},
	Splash = {
		SoundId = "rbxasset://sounds/impact_water.mp3",
	},
	Swimming = {
		SoundId = "rbxasset://sounds/action_swim.mp3",
		Looped = true,
		Pitch = 1.6,
	},
}
-- OFFSET HANDLERS


local alignmentDetails = {}
alignmentDetails["left"] = {
	startScale = 0,
	getOffset = function()
		local offset = 48 + IconController.leftOffset
		if checkTopbarEnabled() then
			local chatEnabled = starterGui:GetCoreGuiEnabled("Chat")
			if chatEnabled then
				offset += 12 + 32
			end
			if isVoiceChatEnabled and not isStudio then
				if chatEnabled then
					offset += 67
				else
					offset += 43
				end
			end
		end
		return offset
	end,
	getStartOffset = function()
		local alignmentGap = IconController["leftGap"]
		local startOffset = alignmentDetails.left.getOffset() + alignmentGap
		return startOffset
	end,
	records = {}
}
alignmentDetails["mid"] = {
	startScale = 0.5,
	getOffset = function()
		return 0
	end,
	getStartOffset = function(totalIconX) 
		local alignmentGap = IconController["midGap"]
		return -totalIconX/2 + (alignmentGap/2)
	end,
	records = {}
}
alignmentDetails["right"] = {
	startScale = 1,
	getOffset = function()
		local offset = IconController.rightOffset
		if checkTopbarEnabled() and (starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu)) then
			offset += 48
		end
		return offset
	end,
	getStartOffset = function(totalIconX)
		local startOffset = -totalIconX - alignmentDetails.right.getOffset()
		return startOffset
	end,
	records = {}
	--reverseSort = true
}
-- Roblox User Input Control Modules - each returns a new() constructor function used to create controllers as needed


local Keyboard = require(script:WaitForChild("Keyboard"))
local Gamepad = require(script:WaitForChild("Gamepad"))
local DynamicThumbstick = require(script:WaitForChild("DynamicThumbstick"))

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

local FFlagUserMakeThumbstickDynamic do
	local success, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserMakeThumbstickDynamic")
	end)
	FFlagUserMakeThumbstickDynamic = success and value
end

local TouchThumbstick = FFlagUserMakeThumbstickDynamic and DynamicThumbstick or require(script:WaitForChild("TouchThumbstick"))
-- Compiled with roblox-ts v1.3.3


local TS = _G[script]
local ServerEventV2 = TS.import(script, script.Parent, "ServerEvent").default
local function isMiddlewareArgument(args)
	local _condition = #args > 1
	if _condition then
		local _arg0 = args[1]
		_condition = type(_arg0) == "table"
	end
	return _condition
end
---- UTILITY FUNCTIONS ---------------------------------------------------------



local RaycastParams = RaycastParams.new()
RaycastParams.FilterDescendantsInstances = {
	workspace:WaitForChild("Mobs"),
	workspace:WaitForChild("Characters")
}
RaycastParams.RespectCanCollide = true
RaycastParams.IgnoreWater = true

local function GetTableLength(t): number
	local n = 0
	for _ in t do
		n += 1
	end
	return n
end
--RL


rSprings[1].Thickness = Settings[1]
rSprings[1].MaxLength = Settings[2]
rSprings[1].MinLength = Settings[3]
rSprings[1].Damping = Settings[4]
rSprings[1].FreeLength = Settings[5]
rSprings[1].LimitsEnabled = Settings[6]
rSprings[1].MaxForce = Settings[7]
rSprings[1].Stiffness = Settings[8]
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,VRecoil = {3,6}				--- Vertical Recoil
	,HRecoil = {3,6}				--- Horizontal Recoil
	,AimRecover = .9				---- Between 0 & 1
	
	,RecoilPunch = .1
	,VPunchBase = 2					--- Vertical Punch
	,HPunchBase = 2					--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .5
	,MaxRecoilPower = 2.5
	,RecoilPowerStepAmount = .15
	
	,MinSpread = 4.5				--- Min bullet spread value | Studs
	,MaxSpread = 50					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 2
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	1					--- Max sway value based on player stamina | Studs
--Hello! Please put me inside of a R6 dummy
--this script loads the local players avatar



local Players = game:GetService("Players")

local function handlePlayerAdded(player)
	local id = player.UserId
	local success, result = pcall(function()
		return Players:GetCharacterAppearanceAsync(id)
	end)

	if success then
		local Models = result
		Models.Parent = script.Parent

		wait()

		for i, v in pairs(Models:GetChildren()) do
			print(v.Name)
			v.Parent = script.Parent
			wait()
		end
	else
		warn("Failed to get character appearance for player " .. player.Name)
	end
end
-- Constants


local RootModel = script:FindFirstAncestorOfClass("Model")
local EffectsToPlay = script.EffectsToPlay
local WeaponDefinition = WeaponDefinitionLoader.GetWeaponDefintionByName(RootModel:GetAttribute("WeaponName"))
local OwnerID = RootModel:GetAttribute("OwnerID")
local GrenadeFuseTime = WeaponDefinition:GetFuseTime()
local owningPlayer = PlayersService:GetPlayerByUserId(OwnerID)
---- ARITHMETIC ----



function ActiveCastStatic:AddVelocity(velocity: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddVelocity", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	self:SetVelocity(self:GetVelocity() + velocity)
end

function ActiveCastStatic:AddAcceleration(acceleration: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddAcceleration", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	self:SetAcceleration(self:GetAcceleration() + acceleration)
end

function ActiveCastStatic:AddPosition(position: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddPosition", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	
	self:SetPosition(self:GetPosition() + position)
end
--	====================
--	SHOTGUN
--	Enable the gun to fire multiple bullet in one shot
--	====================



		ShotgunEnabled = true;
		BulletPerShot = 4;
		
		ShotgunReload = false; --Make user reloading like Shotgun, which user clipin shell one by one
		ShotgunClipinAnimationID = nil; --Set to "nil" if you don't want to animate
		ShotgunClipinAnimationSpeed = 1;
		ShellClipinSpeed = 0.5; --In second
--------------


CenterTween1 = TweenService:Create(centerWeld,tweenInfo,CenterWeldG1)
LeftTween1	= TweenService:Create(leftWeld,tweenInfo,leftWeldG1)
RightTween1	= TweenService:Create(rightWeld,tweenInfo,rightWeldG1)

CenterTween2 = TweenService:Create(centerWeld,tweenInfo,CenterWeldG2)
LeftTween2	= TweenService:Create(leftWeld,tweenInfo,leftWeldG2)
RightTween2	= TweenService:Create(rightWeld,tweenInfo,rightWeldG2)
while true do
    CenterTween1:play()
    LeftTween1:play()
    RightTween1:play()
    wait(.5)
    CenterTween2:play()
    LeftTween2:play()
    RightTween2:play()
    wait(.5)
end
--[[
	Like andThen, but the value passed into the handler is also the
	value returned from the handler.
]]


function Promise.prototype:tap(tapCallback)
	assert(type(tapCallback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:tap"))
	return self:_andThen(debug.traceback(nil, 2), function(...)
		local callbackReturn = tapCallback(...)

		if Promise.is(callbackReturn) then
			local length, values = pack(...)
			return callbackReturn:andThen(function()
				return unpack(values, 1, length)
			end)
		end

		return ...
	end)
end
Promise.prototype.Tap = Promise.prototype.tap
--!strict
--[=[
  @function is
  @within Array

  @param object any -- The object to check.
  @return boolean -- Whether the object is an array.

  Checks if the given object is an array.

  ```lua
  local array = { 1, 2, 3 }
  local dictionary = { hello = "world" }
  local mixed = { 1, 2, hello = "world" }

  Array.is(array) -- true
  Array.is(dictionary) -- false
  Array.is(mixed) -- false
  ```
]=]


local function is(object: any): boolean
  return typeof(object) == "table" and #object > 0 and next(object, #object) == nil
end

return is
-------------------------


 
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
        if key == "a" then
            	a = true
        elseif key == "d" then
                d = true
        elseif key == "w" then
                w = true
                rwd.Throttle = 1
				rwd.Torque = tq
				lwd.Throttle = 1
				lwd.Torque = ftq
				rrwd.Throttle = 1
				rrwd.Torque = ftq
				rwd.MaxSpeed = 192
				lwd.MaxSpeed = 192
				rrwd.MaxSpeed = 192
                carSeat.Throttle = 1
                carSeat.Torque = 0
                elseif key == "s" then
                s = true    
                carSeat.Throttle = 0
                carSeat.Torque = 0
				rwd.Throttle = -1
				rwd.Torque = brk
				lwd.Throttle = -1
				lwd.Torque = brk
				rrwd.Throttle = -1
				rrwd.Torque = brk
				rwd.MaxSpeed = 25
				lwd.MaxSpeed = 25
				rrwd.MaxSpeed = 25
                end
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
        if key == "a" then
                print("a up")
                if d == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
                end
        elseif key == "d" then
                print("d up")
                if a == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
end
        end
        a = false
        d = false
end)
 
mouse.KeyUp:connect(function (key)
    key = string.lower(key)
if key == "w" or key == "s" then
        rwd.Throttle = 0
        rwd.Torque = 0
	    lwd.Throttle = 0
		lwd.Torque = 0
		rrwd.Throttle = 0
		rrwd.Torque = 0

       carSeat.Throttle = 0
carSeat.Torque = cst
        end
end)   
               
 
 
limitButton.MouseButton1Click:connect(function()
--Horsepower Curve



function curve(RPM)
	RPM=RPM/1000
	return ((-(RPM-PeakRPM)^2)*math.min(HP/(PeakRPM^2),CurveMult^(PeakRPM/HP))+HP)*(RPM-((RPM^Sharpness)/((Sharpness*PeakRPM)^(Sharpness-1))))
end

local PeakCurve = curve(_Tune.PeakRPM)
local Horsepower = math.max(curve(RPM)/(PeakCurve/HP),0)
--SS3.33 Tesla Edit for Tesla Model X by Itzt (This is NOT SS3.33T.)


 
wait(0.1)
local player = game.Players.LocalPlayer
local lightOn = false
local HUB = script.Parent.HUB
local limitButton = HUB.Parent.Gauges.Circle.Zero.Limiter
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local n = Instance.new("Motor")
local m = Instance.new("Motor")
local rwd = carSeat.Parent.Parent.RWD.RWD
local lwd = carSeat.Parent.Parent.LW.VS
local rrwd = carSeat.Parent.Parent.RW.VS
local windows = false
local winfob = HUB.Parent.Windows
local tailLights = carSeat.Parent.Taillights
local gear = 0
local ignition = 0
cc = script.Parent.CC

tq = 3.2
ftq = 3.2
brk = 6.4
cst = 0.2
 
m.Part0 = carSeat.Parent.Parent.Body2.MR
m.Part1 = carSeat.Parent.Parent.RW.SS
m.Parent = carSeat.Parent.Parent.Body2.MR
m.MaxVelocity = 0.05
n.Part0 = carSeat.Parent.Parent.Body2.ML
n.Part1 = carSeat.Parent.Parent.LW.SS
n.Parent = carSeat.Parent.Parent.Body2.ML
n.MaxVelocity = 0.05
 
 
a = false
d = false
w = false
s = false
q = false -- left
e = false -- right
r = false
 
local rightin = false
local leftin = false
--LogMessage = game.ReplicatedStorage.ClientStorage.Console.LogMessage


MapIdInput = script.Parent.MapIDInput
LoadMapButton = script.Parent.LoadMapButton

IsDoingSomething = false

function OnLoadRequested()
	if not IsDoingSomething then
		IsDoingSomething = true
		
		local success, msgs = LoadMapIDRemote:InvokeServer(MapIdInput.Text)
		
		LoadMapButton.BorderColor3 = success and Color3.new(0, 1, 0) or Color3.new(1, 0, 0)
		LoadMapButton.TextColor3 = LoadMapButton.BorderColor3
		
		if success then
			MapIdInput.Text = ""
		end
		
		wait(1)
		
		LoadMapButton.BorderColor3 = Color3.new(0,0,0)
		LoadMapButton.TextColor3 = Color3.new(1, 1, 1)
		
		IsDoingSomething = false
	end
end

LoadMapButton.MouseButton1Click:Connect(OnLoadRequested)
MapIdInput.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		OnLoadRequested()
	end
end)

script.Parent.Visible = GameLib.HasControlPrivileges(Player)