Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Clear any existing animation tracks
-- Fixes issue with characters that are moved in and out of the Workspace accumulating tracks


local animator = if Humanoid then Humanoid:FindFirstChildOfClass("Animator") else nil
if animator then
	local animTracks = animator:GetPlayingAnimationTracks()
	for i,track in ipairs(animTracks) do
		track:Stop(0)
		track:Destroy()
	end
end

for name, fileList in pairs(animNames) do
	configureAnimationSet(name, fileList)
end
for _,child in script:GetChildren() do
	if child:isA("StringValue") then
		animNames[child.Name] = {}
		configureAnimationSet(child.Name, animNames[child.Name])
	end
end
-- ROBLOX TODO: fix PrettyFormat types imports
-- local PrettyFormat = require(Packages.PrettyFormat)


local PrettyFormat = require(CurrentModule.PrettyFormat)
type PrettyFormatOptions = PrettyFormat.OptionsReceived

local utils = require(CurrentModule.utils)
local addExtraLineBreaks = utils.addExtraLineBreaks
local getSnapshotData = utils.getSnapshotData
local keyToTestName = utils.keyToTestName
local removeExtraLineBreaks = utils.removeExtraLineBreaks
--[ MAIN LOCALS ]-



local Player = game.Players.LocalPlayer
local Event = game.ReplicatedStorage.MusicEvents.NewSong
local Frame = script.Parent.Parent
local Gui = game.StarterGui.SurfaceGui.SongPart.Frame.SongName
local SongText = Gui.Text
local sound = game.Workspace.Sound
local label = script.Parent.Parent.Requester
-- Custom enum implementation that provides an effective way to compare, send
-- and store values. Instead of returning a userdata value, enum items return
-- their corresponding itemValue (an integer) when indexed. Enum items can
-- also associate a 'property', specified as the third element, which can be
-- retrieved by doing ``enum.getProperty(ITEM_NAME_OR_VALUE)``
-- This ultimately means groups of data can be easily categorised, efficiently
-- transmitted over networks and saved without throwing errors.
-- Ben Horton (ForeverHD)
--local TwoHandAnim = hammer:WaitForChild("TwoHandAnim")



hammer.Equipped:Connect(function()
	local character = hammer.Parent
	if Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then
		--character.Humanoid.Animator:LoadAnimation(TwoHandAnim):Play()
		end
end)


hammer.Activated:Connect(function()
	local character = hammer.Parent
	if db == false and Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then

		--character.Humanoid.Animator:LoadAnimation(Slash):Play() -- Plays the animation

		local touchFunction
		touchFunction = hammer.Handle.Touched:Connect(function(hit) -- Fires when the hammer is touched
			local hitCharacter = hit:FindFirstAncestorOfClass("Model") -- The character we hit
			local hitPlayer = Players:GetPlayerFromCharacter(hitCharacter) -- Player we it
			local banSound = script.Parent.Handle.ban
			if hit and hitCharacter and hitPlayer then -- if we hit a player
				--banSave:SetAsync(hitPlayer.UserId,true) -- Saves the ban (Don't do this if you only want to kick them)
				hitPlayer:Kick("Congratulations! You just got kicked by the ban hammer! Be lucky you didn't banned instead!") -- Kicks with the provided message
				banSound:Play()
				touchFunction:Disconnect() -- Ends the function
			end
		end)

		db = true -- Enables cooldown
		task.wait(1) -- You might need to adjust this
		touchFunction:Disconnect()
		task.wait(1-0.3) -- The cooldown
		db = false -- Disables cooldown

	end
end)
-- Create debris for specified part (being destroyed)	


local function createDebris(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local scale = 1
	
	if targetPart:IsA("Model") then
		local plate = targetPart:FindFirstChild("Plate", true)
		pos = plate.Position
		scale = plate.Size.X/8
	else
		pos = targetPart.Position
		scale = targetPart.Size.X/8
	end	
	
	local debris = debrisParts[math.random(1, #debrisParts)]:Clone()
	--local pos2 = getPositionRelativetoBase(debris.PrimaryPart, pos)
	local pos2 = pos
	debris:SetPrimaryPartCFrame(CFrame.new(pos2))
	scaleModel(debris, scale)
	debris.Parent = mapManager.getMap()
	
	targetPart:Destroy()
	
	return debris.PrimaryPart
end
--local RecipesFrame = InventoryFrame.Recipes;



local Sizes = {
	
	[ItemsFrame] = {
		[EquipButton] = {
			Size = ItemsFrame.Size;
			Position = ItemsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,-427,1,-155);
			Position = ItemsFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,-427,1,-200);
			Position = ItemsFrame.Position;
		};
	};
	
	[ActionsFrame] = {
		[EquipButton] = {
			Size = ActionsFrame.Size;
			Position = ActionsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(1,0,0,160);
			Position = UDim2.new(0,0,1,-160);
		};
		[RecycleButton] = {
			Size = UDim2.new(1,0,0,205);
			Position = UDim2.new(0,0,1,-205);
		};
	};
	
	[EquippedFrame] = {
		[EquipButton] = {
			Size = EquippedFrame.Size;
			Position = EquippedFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,130,1,-155);
			Position = UDim2.new(1,0,0,0);
		};
		[RecycleButton] = {
			Size = UDim2.new(0,130,1,-200);
			Position = EquippedFrame.Position;
		};
	};
	
	--[[[RecipesFrame] = {
		[EquipButton] = {
			Size = RecipesFrame.Size;
			Position = RecipesFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,292,1,-155);
			Position = RecipesFrame.Position; --EquippedFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,0,1,-200);
			Position = ItemsFrame.Position;
		};
	};]]
	
};
--[[setmetatable(
    PriorityQueue,
    {
        __call = function (self)
            setmetatable({}, self)
            self:initialize()
            return self
        end
    }
)]]



function PriorityQueue.new()
	local queueData = {}
	setmetatable(queueData,PriorityQueue)
	
	 queueData:initialize()

	return queueData
end


function PriorityQueue:initialize()
    --[[  Initialization.
    Example:
        PriorityQueue = require("priority_queue")
        pq = PriorityQueue()
    ]]--
    self.heap = {}
    self.current_size = 0
end

function PriorityQueue:empty()
    return self.current_size == 0
end

function PriorityQueue:size()
    return self.current_size
end

function PriorityQueue:swim()
    -- Swim up on the tree and fix the order heap property.
    local heap = self.heap
    local floor = floor
    local i = self.current_size

    while floor(i / 2) > 0 do
        local half = floor(i / 2)
        if heap[i][2] < heap[half][2] then
            heap[i], heap[half] = heap[half], heap[i]
        end
        i = half
    end
end

function PriorityQueue:push(v, p)
    --[[ Put an item on the queue.
    Args:
        v: the item to be stored
        p(number): the priority of the item
    ]]--
    --

    self.heap[self.current_size + 1] = {v, p}
    self.current_size = self.current_size + 1
    self:swim()
end

function PriorityQueue:sink()
    -- Sink down on the tree and fix the order heap property.
    local size = self.current_size
    local heap = self.heap
    local i = 1

    while (i * 2) <= size do
        local mc = self:min_child(i)
        if heap[i][2] > heap[mc][2] then
            heap[i], heap[mc] = heap[mc], heap[i]
        end
        i = mc
    end
end

function PriorityQueue:min_child(i)
    if (i * 2) + 1 > self.current_size then
        return i * 2
    else
        if self.heap[i * 2][2] < self.heap[i * 2 + 1][2] then
            return i * 2
        else
            return i * 2 + 1
        end
    end
end

function PriorityQueue:pop()
    -- Remove and return the top priority item
    local heap = self.heap
    local retval = heap[1][1]
    heap[1] = heap[self.current_size]
    heap[self.current_size] = nil
    self.current_size = self.current_size - 1
    self:sink()
    return retval
end

return PriorityQueue
--[[
	@class stringTween
	contains library of functions that add/remove text from a string.
	
	.backward:
		@params: string, function, string?, config?
     	@info: clears text or until hit `StopAt`		
	
	.forward: 
		@params: string, string, function, config?
		@info: adds `newText` to the given string

	```lua
		local stringTween = require(container.stringTween)

		local startText = 'person'
		local newText = 'son'
		local stopAt = 'per'		

		local predicate = function(text)
			startText = text
		end

		stringTween.backward(startText, predicate, stopAt) > returns per
		stringTween.forward(startText, newText, predicate) > returns person
	```
]]



local stringTween = {}

function stringTween.forward(
	s: string, 
	apply: string, 
	predicate: (string) -> (), 
	config: config?
)
	if config then
		config.delay = config.delay or defaultconfig.delay
		config.movement = config.movement or defaultconfig.movement
	end

	local config = config or defaultconfig
	local result
	
	for i = 0, #apply, 1 do
		result = `{s}{string.sub(apply, 1, i)}{config.movement}`
		
		predicate(result)
		
		task.wait(config.delay)
	end
	
	result = result:sub(1, #result - #config.movement)
	predicate(result)
	
	return result
end

function stringTween.backward(
	s: string, 
	predicate: (string) -> (), 
	breakat: string?, 
	config: config?
)
	if config then
		config.delay = config.delay or defaultconfig.delay
		config.movement = config.movement or defaultconfig.movement
	end
	
	local config = config or defaultconfig
	local result
	
	for i = #s, 0, -1 do
		result = `{string.sub(s, 1, i)}{config.movement}`
		predicate(result)
		
		if breakat and string.sub(result, 1, -1) == `{breakat}{config.movement}` then
			break 
		end
		task.wait(config.delay)
	end
	
	result = string.sub(result, 1, #result - #config.movement)
	predicate(result)
	
	return result
end

return stringTween
--[[Weight and CG]]


	Tune.Weight			= 3590		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-----------------
--| Variables |--
-----------------



local DebrisService = Game:GetService('Debris')
local PlayersService = Game:GetService('Players')

local Tool = script.Parent
local ToolHandle = Tool.Handle

local RocketScript = WaitForChild(script, 'Rocket')

local SwooshSound = WaitForChild(script, 'Swoosh')
local BoomSound = WaitForChild(script, 'Boom')
local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
local FireSound = WaitForChild(ToolHandle, 'FireSound')

local MyModel = nil
local MyPlayer = nil

local BaseRocket = nil
local RocketClone = nil
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 600		--	[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)
--[=[
	Defers the subscription and creation of the observable until the
	actual subscription of the observable.

	https://rxjs-dev.firebaseapp.com/api/index/function/defer
	https://netbasal.com/getting-to-know-the-defer-observable-in-rxjs-a16f092d8c09

	@param observableFactory () -> Observable<T>
	@return Observable<T>
]=]


function Rx.defer(observableFactory)
	return Observable.new(function(sub)
		local observable
		local ok, err = pcall(function()
			observable = observableFactory()
		end)

		if not ok then
			sub:Fail(err)
			return
		end

		if not Observable.isObservable(observable) then
			sub:Fail("Not an observable")
			return
		end

		return observable:Subscribe(sub:GetFireFailComplete())
	end)
end
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
--		child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player


		if child.Part1.Name == "HumanoidRootPart" then
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
				GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
				GUI:Clone().Parent = player.PlayerGui --// Compact version
				if script.Parent.L.Value == true then --because you can't get in a locked car
					wait()
					script.Parent.Disabled = true
					wait()
					script.Parent.Disabled = false
				end
				script.Parent.Occupied.Value = true
				
				
				script.Parent.Parent.Body.Dash.dash.D.Transparency = 0
				script.Parent.CanStart.Value = true
				script.Parent.Parent.Body.Dash.Spd.Interface.Enabled = true
				script.Parent.Parent.Body.Dash.Tac.Interface.Enabled = true
-- Written By Kip Turner, Copyright Roblox 2014
-- Updated by Garnold to utilize the new PathfindingService API, 2017



local DEBUG_NAME = "ClickToMoveController"

local UIS = game:GetService("UserInputService")
local PathfindingService = game:GetService("PathfindingService")
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")
local DebrisService = game:GetService('Debris')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local tweenService = game:GetService("TweenService")



local Player = PlayerService.LocalPlayer
local PlayerScripts = Player.PlayerScripts

local CameraScript = script:FindFirstAncestor("CameraScript")
local InvisicamModule = nil
if CameraScript then
	InvisicamModule = require(CameraScript:WaitForChild("Invisicam"))
end

local MasterControlModule = script.Parent
local MasterControl = require(MasterControlModule)
local TouchJump = nil
if MasterControl then
	local TouchJumpModule = MasterControlModule:FindFirstChild("TouchJump")
	if TouchJumpModule then
		TouchJump = require(TouchJumpModule)
	end
end

local SHOW_PATH = true

local RayCastIgnoreList = workspace.FindPartOnRayWithIgnoreList

local math_min = math.min
local math_max = math.max
local math_pi = math.pi
local math_atan2 = math.atan2

local Vector3_new = Vector3.new
local Vector2_new = Vector2.new
local CFrame_new = CFrame.new

local CurrentSeatPart = nil
local DrivingTo = nil

local XZ_VECTOR3 = Vector3_new(1, 0, 1)
local ZERO_VECTOR3 = Vector3_new(0, 0, 0)
local ZERO_VECTOR2 = Vector2_new(0, 0)

local lastFailedPosition = nil

local BindableEvent_OnFailStateChanged = nil
if UIS.TouchEnabled then
	BindableEvent_OnFailStateChanged = MasterControl:GetClickToMoveFailStateChanged()
end
--- Creates a listable type from a singlular type


function Util.MakeListableType(type, override)
	local listableType = {
		Listable = true,
		Transform = type.Transform,
		Validate = type.Validate,
		Autocomplete = type.Autocomplete,
		Default = type.Default,
		Parse = function(...)
			return {type.Parse(...)}
		end
	}

	if override then
		for key, value in pairs(override) do
			listableType[key] = value
		end
	end

	return listableType
end

local function encodeCommandEscape(text)
	return (text:gsub("\\%$", "___!CMDR_DOLLAR!___"))
end

local function decodeCommandEscape(text)
	return (text:gsub("___!CMDR_DOLLAR!___", "$"))
end

function Util.RunCommandString(dispatcher, commandString)
	commandString = Util.ParseEscapeSequences(commandString)
	commandString = Util.EncodeEscapedOperators(commandString)

	local commands = commandString:split("&&")

	local output = ""
	for i, command in ipairs(commands) do
		local outputEncoded = output:gsub("%$", "\\x24")
		command = command:gsub("||", output:find("%s") and ("%q"):format(outputEncoded) or outputEncoded)

		output = tostring(
			dispatcher:EvaluateAndRun(
				(
					Util.RunEmbeddedCommands(dispatcher, command)
				)
			)
		)


		if i == #commands then
			return output
		end
	end
end
--[[
	Calls any :finally handlers. We need this to be a separate method and
	queue because we must call all of the finally callbacks upon a success,
	failure, *and* cancellation.
]]


function Promise.prototype:_finalize()
	for _, callback in ipairs(self._queuedFinally) do
		-- Purposefully not passing values to callbacks here, as it could be the
		-- resolved values, or rejected errors. If the developer needs the values,
		-- they should use :andThen or :catch explicitly.
		callback(self._status)
	end

	-- Allow family to be buried
	self._parent = nil
	self._consumers = nil
end

return Promise
-- ROBLOX TODO: add generic type constraints <EachCallback extends Global.TestCallback>


function applyArguments<EachCallback>(
	supportsDone: boolean,
	params: Array<any>,
	test: Global_EachTestFn<EachCallback>
): Global_EachTestFn<any>
	local argumentCount
	if typeof(test) == "function" then
		argumentCount = debug.info(test, "a")
	else
		argumentCount = 0 -- ROBLOX CHECK: jest.fn()?
	end

	-- ROBLOX deviation START: add logic to unpack and convert NIL placeholders
	local replaceNilPlaceholders
	function replaceNilPlaceholders(val: any): any
		if val == NIL then
			return nil
		elseif Array.isArray(val) then
			return Array.map(val, function(item)
				return replaceNilPlaceholders(item)
			end)
		elseif typeof(val) == "table" then
			Array.forEach(Object.keys(val), function(key)
				val[key] = replaceNilPlaceholders(val[key])
			end)
			return val
		end

		return val
	end

	local unpackTable
	function unpackTable(obj: Array<any>, i_: number?, ...: any)
		local i = if i_ ~= nil then i_ else #obj
		if i == 0 then
			return ...
		end
		return unpackTable(obj, i - 1, replaceNilPlaceholders(obj[i]), ...)
	end
	-- ROBLOX deviation END

	return if supportsDone and #params < argumentCount
		then function(done: Global_DoneFn)
			return test(unpackTable(params), done)
		end
		else function()
			return test(unpackTable(params))
		end
end
return exports
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	
	--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		= "Dark stone grey"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- Local Functions


local function OnPlayerAdded(player)
	-- Setup leaderboard stats
	local leaderstats = Instance.new('Model', player)
	leaderstats.Name = 'leaderstats'
	
	local Captures = Instance.new('IntValue', leaderstats)
	Captures.Name = 'Captures'
	Captures.Value = 0
	
	-- Add player to team
	TeamManager:AssignPlayerToTeam(player)
	
	player.CharacterAdded:connect(function(character)
		character:WaitForChild('Humanoid').Died:connect(function()
			wait(Configurations.RESPAWN_TIME)
			if GameRunning then
				player:LoadCharacter()
			end
		end)
	end)	
	
	-- Check if player should be spawned	
	if PlayersCanSpawn then
		player:LoadCharacter()
	else
		DisplayManager:StartIntermission(player)
	end	

end

local function OnPlayerRemoving(player)
	TeamManager:RemovePlayer(player)
end
--[=[
	Adds json to a localization table

	@param localizationTable LocalizationTable -- The localization table to add to
	@param localeId string -- The localeId to use
	@param json string -- The json to add with
	@param tableName string -- Used for source
]=]


function JsonToLocalizationTable.addJsonToTable(localizationTable, localeId, json, tableName)
	assert(type(tableName) == "string", "Bad tableName")

	local decodedTable = HttpService:JSONDecode(json)
	recurseAdd(localizationTable, localeId, "", decodedTable, tableName)
end

return JsonToLocalizationTable
--Get in a seat


local function enterStart()
	--Tell server we're trying to get in
	GetInStart:FireServer(AdornedSeat)

	--Wait until player lets go of button (causing them to get in) or seat out of range (nothing happens)
	while EnterKeyDown and AdornedSeat do
		wait()
	end

	if AdornedSeat then
		--Tell server we are getting in seat
		Remotes.GetInSeat:FireServer(AdornedSeat)
		local n = 0
		repeat
			wait()
			n = n + 1
		until AdornedSeat == nil or n>20
		EnterImageButton.Visible = true
		
		local hum = getLocalHumanoid()
		if hum then
			if hum.Sit then
				-- load animations only when player is in the vehicle
				local hum = getLocalHumanoid()
				if hum ~= currentHumanoid then -- load only when we have a new humanoid
					currentHumanoid = hum
					local anims = animationFolder:GetChildren()
					for i = 1, #anims do
						AnimationTracks[anims[i].Name] = hum:LoadAnimation(anims[i])
					end
				end
				
				-- play seated animation
				local seat = hum.SeatPart
				local prefix = (seat.ClassName == "VehicleSeat" and "Driver" or "Passenger")
				local preferredAnimation = AnimationTracks[prefix.."_Seated"]
				if preferredAnimation then
					preferredAnimation.Priority = Enum.AnimationPriority.Action
					preferredAnimation:Play()
				end
			end
		end
	end
end