Roblox/luau_corpus huggingface dataset:
-- tableUtil.Assign(Table target, ...Table sources)
local function Assign(target, ...)
	for _,src in ipairs({...}) do
		for k,v in pairs(src) do
			target[k] = v
		end
	end
	return target
end


local function Print(tbl, label, deepPrint)

	assert(type(tbl) == "table", "First argument must be a table")
	assert(label == nil or type(label) == "string", "Second argument must be a string or nil")
	
	label = (label or "TABLE")
	
	local strTbl = {}
	local indent = " - "
	
	-- Insert(string, indentLevel)
	local function Insert(s, l)
		strTbl[#strTbl + 1] = (indent:rep(l) .. s .. "\n")
	end
	
	local function AlphaKeySort(a, b)
		return (tostring(a.k) < tostring(b.k))
	end
	
	local function PrintTable(t, lvl, lbl)
		Insert(lbl .. ":", lvl - 1)
		local nonTbls = {}
		local tbls = {}
		local keySpaces = 0
		for k,v in pairs(t) do
			if (type(v) == "table") then
				table.insert(tbls, {k = k, v = v})
			else
				table.insert(nonTbls, {k = k, v = "[" .. typeof(v) .. "] " .. tostring(v)})
			end
			local spaces = #tostring(k) + 1
			if (spaces > keySpaces) then
				keySpaces = spaces
			end
		end
		table.sort(nonTbls, AlphaKeySort)
		table.sort(tbls, AlphaKeySort)
		for _,v in pairs(nonTbls) do
			Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. v.v, lvl)
		end
		if (deepPrint) then
			for _,v in pairs(tbls) do
				PrintTable(v.v, lvl + 1, tostring(v.k) .. (" "):rep(keySpaces - #tostring(v.k)) .. " [Table]")
			end
		else
			for _,v in pairs(tbls) do
				Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. "[Table]", lvl)
			end
		end
	end
	
	PrintTable(tbl, 1, label)
	
	print(table.concat(strTbl, ""))
	
end


local function IndexOf(tbl, item)
	for i = 1,#tbl do
		if (tbl[i] == item) then
			return i
		end
	end
	return nil
end


local function Reverse(tbl)
	local n = #tbl
	local tblRev = table.create(n)
	for i = 1,n do
		tblRev[i] = tbl[n - i + 1]
	end
	return tblRev
end


local function Shuffle(tbl)
	assert(type(tbl) == "table", "First argument must be a table")
	local rng = Random.new()
	for i = #tbl, 2, -1 do
		local j = rng:NextInteger(1, i)
		tbl[i], tbl[j] = tbl[j], tbl[i]
	end
end


local function IsEmpty(tbl)
	return (next(tbl) == nil)
end


local function EncodeJSON(tbl)
	return http:JSONEncode(tbl)
end


local function DecodeJSON(str)
	return http:JSONDecode(str)
end


local function FastRemoveFirstValue(t, v)
	local index = IndexOf(t, v)
	if (index) then
		FastRemove(t, index)
		return true, index
	end
	return false, nil
end


TableUtil.Copy = CopyTable
TableUtil.CopyShallow = CopyTableShallow
TableUtil.Sync = Sync
TableUtil.FastRemove = FastRemove
TableUtil.FastRemoveFirstValue = FastRemoveFirstValue
TableUtil.Print = Print
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.IndexOf = IndexOf
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON


return TableUtil
--[[Steering]]
	Tune.SteerInner		= 49		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 50		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .02		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- 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
-- options -------------------------

setupmode = "Auto" -- Manual or Auto (if you want to pick what plugins you have yourself or you want it to be automated)
soundplugin = "StockSound"	-- StockSound, SoundSuite or 1.5 Sound (no others are supported, sorry!) (MANUAL ONLY)
camkey = "v" -- the key you use for first person camera
level = 28 -- 0% - 100% 
exceptions = {"Horn","Engine","Ignition","Smoke"} -- put names of audios to ignore here (AUTO ONLY)
--[=[
	Constructs a new value object
	@param baseValue T
	@return ValueObject
]=]
function ValueObject.new(baseValue)
	local self = {}

	rawset(self, "_value", baseValue)

	self._maid = Maid.new()
-- Get the correct sound from our sound list.
local function getSoundProperties()
	for name, data in pairs(IDList) do
		if name == material then
			oldWalkSpeed = humanoid.WalkSpeed
			id = data.id
			volume = data.volume
			
			playbackSpeed = (humanoid.WalkSpeed / 16) * data.speed
			break
		end
	end
end
-- Initialization
local MapPurgeProof = game.Workspace:FindFirstChild("MapPurgeProof")
if not MapPurgeProof then
	MapPurgeProof = Instance.new("Folder", game.Workspace)
	MapPurgeProof.Name = "MapPurgeProof"
end
--// Tables
local L_65_ = {
	
	"285421759";
	"151130102";
	"151130171";
	"285421804";
	"287769483";
	"287769415";
	"285421687";
	"287769261";
	"287772525";
	"287772445";
	"287772351";
	"285421819";
	"287772163";
	
}

local L_66_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_66_.Name = "BulletModel: " .. L_2_.Name

local L_67_

local L_68_ = L_21_.Ammo
local L_69_ = L_21_.StoredAmmo * L_21_.MagCount

IgnoreList = {
	L_3_,
	L_66_,
	L_5_
}
--------LEFT DOOR --------

game.Workspace.doorleft.l21.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-------------------------------------------------------------------------------------

Loader:updateModel(Model, Config.userId.Value)

if Config.AutoUpdateCharacter.Value then
	while wait() do
		Loader:updateModel(Model, Config.userId.Value)
	end
end
--[=[
	@param name string
	@param priority number
	@param fn (dt: number) -> nil
	Calls `RunService:BindToRenderStep` and registers a function in the
	Janitor that will call `RunService:UnbindFromRenderStep` on cleanup.

	```lua
	Janitor:BindToRenderStep("Test", Enum.RenderPriority.Last.Value, function(dt)
		-- Do something
	end)
	```
]=]
function Janitor:BindToRenderStep(name: string, priority: number, fn: (dt: number) -> nil)
	RunService:BindToRenderStep(name, priority, fn)
	self:Add(function()
		RunService:UnbindFromRenderStep(name)
	end)
end
-- How many times per second the gun can fire
local FireRate = 5 / 5.5
-- Variables --
local proximityPrompts = {}
local connections = {}
local tween
local isOpen = false

local shrinkSpeed = Settings["Shrink speed"].Value
local teamColorObjectValues = Settings.Teams:GetChildren()

local openGoal
local closedGoal
-- Create component
local ImageLabel = Roact.PureComponent:extend 'ImageLabel'
--[[
	
	Plays an animation on humanoid/character/player. Returns {animationTrack, animation}
	
	Functions.Animation(
		id,						<-- |REQ| 	Animation ID
		instance,				<-- |REQ|	Player/character/humanoid		
	)
	
--]]


return function(id, parent)
	local humanoid
	
	--- Get humanoid
	if parent.ClassName == "Humanoid" then
		humanoid = parent
	elseif parent:FindFirstChildOfClass("Humanoid") then
		humanoid = parent:FindFirstChildOfClass("Humanoid")
	elseif parent.ClassName == "Player" then
		humanoid = parent.Character:FindFirstChild("Humanoid")
	end
	
	--- Play animation
	if humanoid then
		local animation = Instance.new("Animation")
		animation.AnimationId = "rbxassetid://" .. id
		--
		local track = humanoid:LoadAnimation(animation)
		track:Play()
		--
		return track
	end
end
-- Load proper GUI
local gui = Guis:WaitForChild(IS_MOBILE and "MobileGui" or IS_CONSOLE and "ConsoleGui" or "DesktopGui")
gui.Parent = player.PlayerGui
local guiController = require(gui:WaitForChild("GuiController"))
--local Part = script.Parent
--local Org = Part.Position

local rate = 1 / 30

local frames = Time.Value / rate

for frame = 1, frames do
	wait(rate)
	
	local percent = frame / frames
	--Part.Position = Org + Vector3.new(0, 5 * percent, 0)
	Lbl.Value.Parent.StudsOffset = Lbl.Value.Parent.StudsOffset + Vector3.new(0, 0.2, 0)
	Lbl.Value.TextTransparency = percent
	Lbl.Value.TextStrokeTransparency = percent
end
-- Folders to parse into databases
for _, databaseFolder in ipairs(ReplicateStorage.Common.Databases:GetChildren()) do
    Database.ParseFolder(databaseFolder)
end
--// Settings //--

script.Parent.Triggered:Connect(function(plr)
	plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + amount
		s.Playing = true
end)
--Services
local UIS = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local ti = TweenInfo.new(
	
	0.5,
	Enum.EasingStyle.Sine
	
	
)
--s.Pitch = 0.7
s.Volume=1
	s2.Volume=0
while true do
-- If gun has more than one part undisable this and it will weld everything for you!
function Weld(p0,p1)
local weld = Instance.new('Weld')
weld.Part0 = p0
weld.Part1 = p1
weld.C0 = p0.CFrame:inverse()*CFrame.new(p0.Position)
weld.C1 = p1.CFrame:inverse()*CFrame.new(p0.Position)
weld.Parent = p0
end

function WeldIt(obj) if obj then
if obj:IsA('BasePart') then Weld(script.Parent.Handle,obj) end
for i,v in pairs(obj:children()) do WeldIt(v) end
end
end

script.Parent.Equipped:connect(function() WeldIt(script.Parent) end)
script.Parent.Unequipped:connect(function() WeldIt(script.Parent) end)
WeldIt(script.Parent)
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
script.Parent.Material = Enum.Material.Glass
script.Parent.Parent.Parent.On.Changed:Connect(function()
if script.Parent.Parent.Parent.On.Value == true then
script.Parent.Material = Enum.Material.Neon
else 
script.Parent.Material = Enum.Material.Glass
end
end)
--]]
primaryWeaponSlot.ChildAdded:Connect(function(newChild)
	weapon1Label.BackgroundColor3 = offColor
	weapon1Label.Text = newChild.Name
end)
secondaryWeaponSlot.ChildAdded:Connect(function(newChild)
	weapon2Label.BackgroundColor3 = offColor
	weapon2Label.Text = newChild.Name
end)
tertiaryWeaponSlot.ChildAdded:Connect(function(newChild)
	weapon3Label.BackgroundColor3 = offColor
	weapon3Label.Text = newChild.Name
end)
-- Local variable defaults
local startCheckpoint = nil
local finishCheckpoint = nil
local numLaps = 1
local raceDuration = 60
local debugEnabled = false
-------------------------
function onClicked()
R.Function1.Disabled = true

FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true

FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true

FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true

FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true

FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true

FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true

FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true

FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true

FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true

FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true

FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--end
end
end

function Plaka()
for i,v in pairs(Car.Body.Plate:GetChildren()) do
--------END RIGHT DOOR --------

end
wait(0.15)
if game.Workspace.DoorFlashing.Value == true then
--		print("Keyframe : ".. frameName)
		local repeatAnim = stopToolAnimations()
		playToolAnimation(repeatAnim, 0.0, Humanoid)
	end
end

function playToolAnimation(animName, transitionTime, humanoid)
	if animName ~= toolAnimName then
		if toolAnimTrack then
			toolAnimTrack:Stop()
			toolAnimTrack:Destroy()
			transitionTime = 0
		end
		local roll = math.random(1, animTable[animName].totalWeight) 
		local origRoll = roll
		local idx = 1
		while (roll > animTable[animName][idx].weight) do
			roll = roll - animTable[animName][idx].weight
			idx = idx + 1
		end
--Zombie artificial stupidity script
--(Modified for skeletons)

sp=script.Parent
lastattack=0
nextrandom=0
-- This script only needs to run if increment values actually exist.
if earnTime > 0 and earnAmount ~= 0 then
	-- The first shop in the game that loads will parent this script to
	-- ServerScriptService. After that, the other shops will just change
	-- the value of playerObject, and the player gets added to the increment list.
	script.playerObject.Changed:connect(function(value)
		if value and value:IsA("Player") then
			for _, player in next, playersToIncrement do
				if player == value then return end
			end
			table.insert(playersToIncrement, value)
		end
		script.playerObject.Value = nil
	end)

	while wait(earnTime) and wait() do
		for i, player in next, playersToIncrement do
			if player then
				local cash = player.leaderstats:FindFirstChild(cashName)
				if cash then
					cash.Value = cash.Value + earnAmount
				end
			else
				table.remove(playersToIncrement, i)
			end
		end
	end
else
	script:Destroy()
end
--// Recoil Settings	
	gunrecoil = -0.3; -- How much the gun recoils backwards when not aiming
	camrecoil = 0.05; -- How much the camera flicks when not aiming
	AimGunRecoil = -0.1; -- How much the gun recoils backwards when aiming
	AimCamRecoil = 0.02; -- How much the camera flicks when aiming
	
	CamShake = 56; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
	AimCamShake = 38; -- THIS IS ALSO NEW!!!!
	
	Kickback = 3; -- Upward gun rotation when not aiming
	AimKickback = 0.1; -- Upward gun rotation when aiming
-- innit bruv

local renderResolution = 10
local cam = workspace.CurrentCamera
local viewportSize = cam.ViewportSize
-- Driver Input Loop --
while script.Parent ~= nil do
	--Update throttle, steer, handbrake
	getInputValues()

	local currentVel = Chassis.GetAverageVelocity()

	local steer = script.Steering.Value
	Chassis.UpdateSteering(steer, currentVel)

	-- Taking care of throttling
	local throttle = script.Throttle.Value
	script.AngularMotorVelocity.Value = currentVel
	script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
	Chassis.UpdateThrottle(currentVel, throttle)

	-- Taking care of handbrake
	if script.HandBrake.Value > 0 then
		Chassis.EnableHandbrake()
	end
	wait()
end
-- LIGHT SETTINGS
--[[
	LIGHT TYPES:
		- Halogen
		- LED
]]--

local Low_Beam_Brightness = 0.55

local High_Beam_Brightness = 0.80

local Fog_Light_Brightness = 0.7

local Rear_Light_Brightness = 1.0

local Brake_Light_Brightness = 1.5

local Reverse_Light_Brightness = 1

local Headlight_Type = "Halogen"

local Indicator_Type = "Halogen"

local Fog_Light_Type = "Halogen"

local Plate_Light_Type = "Halogen"

local Rear_Light_Type = "Halogen"

local Reverse_Light_Type = "Halogen"

local Running_Light_Location = "Custom DRL" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam".  LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL")

local CustomDRL_Type = "LED"

local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds)

local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds)

local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)
--use this to determine if you want this human to be harmed or not, returns boolean
function checkTeams(otherHuman)
	return not (sameTeam(otherHuman) and not FriendlyFire==true)
end

function boom()
	wait(1.5)
	Used = true
	Object.Anchored = true
	Object.CanCollide = true
	Object.Sparks.Enabled = false
	Object.Orientation = Vector3.new(0,0,0)
	Object.Transparency = 1
	Object.Fuse:Stop()
	Object.Explode:Play()
	Object.Explosion:Emit(100)
	Explode()
end

Object.Touched:Connect(function(part)
	if Used == true or part.Name == "Handle" then return end
	if part:IsDescendantOf(Tag.Value.Character) then return end
	if part.Parent then
		if part.Parent:FindFirstChild("Humanoid") then
			local human = part.Parent.Humanoid
			if checkTeams(human) then
				tagHuman(human)
				human:TakeDamage(Damage)
			end
		end
		Used = true
		Object.Impact:Play()
		Object.Velocity = Vector3.new(Object.Velocity.x/10,Object.Velocity.y/10,Object.Velocity.z/10)
		Object.RotVelocity = Vector3.new(Object.RotVelocity.x/10,Object.RotVelocity.y/10,Object.RotVelocity.z/10)
		game:GetService("Debris"):AddItem(Object, 10)
	end
end)

boom()
---Finds the characters position, based off their torso
local t = P.Character:FindFirstChild("Torso")
if t then
local Char = P.Character
local X = Char.Torso.Position.X
local Y = Char.Torso.Position.Y
local Z = Char.Torso.Position.Z

local X1 = Instance.new("IntValue")
X1.Value = X
local Y1 = Instance.new("IntValue")
Y1.Value = Y
local Z1 = Instance.new("IntValue")
Z1.Value = Z

script.Parent.Text = " " ..X1.Value.. ", " ..Y1.Value.. ", " ..Z1.Value.. " "
end
end
wait(T)
end
--		print(animName .. " " .. idx .. " [" .. origRoll .. "]")
		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		currentAnimTrack = humanoid:LoadAnimation(anim)
		 
		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName

		-- set up keyframe name triggers
		if currentAnimKeyframeHandler then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
	end
end
--[[
	Gamepad Character Control - This module handles controlling your avatar using a game console-style controller
	
	2018 PlayerScripts Update - AllYourBlox		
--]]

local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {};

	for v2, v3 in ipairs(script:GetChildren()) do
	if not v2 then
		break;
	end;
	if v3.ClassName == "ModuleScript" then
		for v5, v6 in pairs((require(v3))) do
			v1[v5] = v6;
		end;
	end;
end;
return v1;
----------------------------------
------------VARIABLES-------------
----------------------------------

PianoId = nil
Connector = game.Workspace:FindFirstChild("GlobalPianoConnector")
local Transposition, Volume = script.Parent:WaitForChild("Transpose"), 1
---Box thing
for _,v in pairs(script.Parent.ShopFrame.Boxes:GetChildren()) do
	if v:IsA("TextButton") then
		v.MouseButton1Click:Connect(function()			
			---Clean
			for _,y in pairs(script.Parent.ShopFrame.BoxContaining.Frame:GetChildren()) do
				if y:IsA("ImageLabel") then
					y:Destroy()
				end
			end
			
			--Add
			local Weaponfolder = game.ReplicatedStorage.Weapons:FindFirstChild(v.Parent.Weapon.Value)
			print(Weaponfolder.Name)
			print(v.Name)
			local Boxfolder = Weaponfolder:FindFirstChild(v.Name)
			local Weapons = Boxfolder:GetChildren()
			if #Weapons > 0 then
				for _,y in pairs(Weapons) do
					local ImgFrame = Instance.new("ImageLabel")
					ImgFrame.Parent = script.Parent.ShopFrame.BoxContaining.Frame
					ImgFrame.Image = y.TextureId
				end
			end
			script.Parent.ShopFrame.BoxContaining.TextLabel.Text = (Boxfolder.Name).." box contains:"
			script.Parent.ShopFrame.BoxContaining.Box.Value = Boxfolder
			script.Parent.ShopFrame.BoxContaining.Visible = true
			script.Parent.ShopFrame.Boxes.Visible = false
		end)
	end
end
--[[

	LOWGames Studios
	Date: 27 October 2022
	by Elder
	
]]--

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1)
	local v1 = Instance.new("Part");
	v1.Anchored = true;
	v1.CanCollide = false;
	v1.Transparency = 1;
	v1.Material = Enum.Material.SmoothPlastic;
	v1.CastShadow = false;
	v1.Size = Vector3.new();
	v1.CFrame = typeof(p1) == "Vector3" and CFrame.new(p1) or p1;
	v1.Name = "host";
	local v2 = Instance.new("Attachment");
	v2.Parent = v1;
	v1.Parent = u1.Debris;
	return v1, v2;
end;
-- Declaring Variables
local ts = game:GetService("TweenService")

local mainUI = script.Parent.Parent

local shopFrame = mainUI.Frame
local shopBtn = mainUI.OpenShop
--!strict
local function startsWith(value: string, substring: string, position: number?): boolean
	if string.len(substring) == 0 then
		return true
	end
	-- Luau FIXME: we have to use a tmp variable, as Luau doesn't understand the logic below narrow position to `number`
	local position_
	if position == nil or position < 1 then
		position_ = 1
	else
		position_ = position
	end

	if position_ > string.len(value) then
		return false
	end
	return value:find(substring, position_, true) == position_
end

return startsWith
--[[
	Sets the text on the touchable button
]]
function BaseSystem:_setButtonText(text)
	local button = self._model:FindFirstChild("ToggleButton")

	if not button then
		return
	end

	local textLabel = button:FindFirstChild("SurfaceGui"):FindFirstChild("Text")

	if not textLabel then
		return
	end

	textLabel.Text = text
end
--Disable script if car is removed from workspace
Car.AncestryChanged:Connect(function()
	if not Car:IsDescendantOf(Workspace) then
		unbindActions()

		LocalVehicleSeating.ExitSeat()
		LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat)
		-- stop seated anim
		--print("car removed from workspace")

		script.Disabled = true
		ProximityPromptService.Enabled = true
	end
end)

local function exitVehicle(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin then
		LocalVehicleSeating.ExitSeat()
		-- stop seated anim
	end
end

local function _updateRawInput(_, inputState, inputObj)
	local key = inputObj.KeyCode
	local data = Keymap.getData(key)

	if not data then 
		return
	end

	local axis = data.Axis
	local val = 0

	if axis then
		val = inputObj.Position:Dot(axis)
	else
		val = (inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change) and 1 or 0
	end

	val = val * (data.Sign or 1)

	_rawInput[key] = val

	if data.Pass then
		return Enum.ContextActionResult.Pass
	end
end

local function _calculateInput(action)
	-- Loop through all mappings for this action and calculate a resultant value from the raw input
	local mappings = Keymap[action]
	local val = 0
	local absVal = val

	for _, data in ipairs(mappings) do
		local thisVal = _rawInput[data.KeyCode]
		if math.abs(thisVal) > absVal then
			val = thisVal
			absVal = math.abs(val)
		end
	end

	return val
end

ContextActionService:BindAction(
	EXIT_ACTION_NAME,
	exitVehicle,
	false,
	Keymap.EnterVehicleGamepad,
	Keymap.EnterVehicleKeyboard
)

ContextActionService:BindActionAtPriority(
	RAW_INPUT_ACTION_NAME,
	_updateRawInput,
	false,
	Enum.ContextActionPriority.High.Value,
	unpack(Keymap.allKeys()))
--[[
	
	Calculates a ratio for interface scaling based on resolution (screen size). Used for scaling down, not up.
	
	Functions.ResolutionScale()
	
--]]


return function()
	--- Return cache
	if tick() - lastCalcTick <= 0.05 then
		return lastCalc
	end
	
	--- calc
	local resolution = camera.ViewportSize
	local resolutionScale = resolution.Magnitude
	local scale = math.clamp(resolutionScale / 1800, 0.33, 1)
	
	--- Cache
	lastCalc = scale
	lastCalcTick = tick()
	
	--
	return scale
end