Pinkstack/roblox-luau-corpus-text huggingface dataset:
--input experince values, output level



local ExperienceCalculator = {}
local ExperienceFactor = 10

local function GetLevelFromExperience(Experience)
	-- http://stackoverflow.com/questions/6954874/php-game-formula-to-calculate-a-level-based-on-exp
	
	return math.floor((ExperienceFactor + math.sqrt(ExperienceFactor * ExperienceFactor - 4 * ExperienceFactor * (-Experience)))/ (2 * ExperienceFactor))
end
ExperienceCalculator.GetLevelFromExperience = GetLevelFromExperience

local function GetExperienceForNextLevel(CurrentExperience)
	if CurrentExperience - 1 == CurrentExperience then -- Math.huge
		return 0
	end
	
	local CurrentLevel = GetLevelFromExperience(CurrentExperience)
	local ExperienceRequired = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))
	--local ExperienceRequiredForCurrentLevel = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))

	local ExperienceLeft = ExperienceRequired - CurrentExperience
	
	return ExperienceLeft
end
ExperienceCalculator.GetExperienceForNextLevel = GetExperienceForNextLevel



local function GetExperienceRequiredForLevel(Level)
	Level = Level - 1 -- Because normally this formula calculates experience required for next level.
	return ExperienceFactor*(Level*(1+Level))
end

ExperienceCalculator.GetExperienceRequiredForLevel = GetExperienceRequiredForLevel


local function GetSubExperience(CurrentExperience)
	-- @return Achieved of next level, Total required for next level, Percent
	
	if CurrentExperience - 1 == CurrentExperience then -- Math.huge
		return 1,1,1
	end
	
	local CurrentLevel = GetLevelFromExperience(CurrentExperience)
	local LastLevel = CurrentLevel-1
	
	local ExperienceRequiredForCurrentLevel = ExperienceFactor*(LastLevel*(1+LastLevel))
	local ExperienceRequired = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))
	

	
	local AchievedOfNext = CurrentExperience - ExperienceRequiredForCurrentLevel 
	local SubTotalRequired = ExperienceRequired - ExperienceRequiredForCurrentLevel
	local Percent = AchievedOfNext/SubTotalRequired
	
	return AchievedOfNext, SubTotalRequired, Percent
end
ExperienceCalculator.GetSubExperience = GetSubExperience

return ExperienceCalculator
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58},t},
[49]={{48,49},t},
[16]={n,f},
[19]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{48,49,45,44,28,29,31,32,34,35,39,41,59},t},
[63]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{48,49,45,44,28,29,31,32,34},t},
[21]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{48},t},
[27]={{48,49,45,44,28,27},t},
[14]={n,f},
[31]={{48,49,45,44,28,29,31},t},
[56]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56},t},
[29]={{48,49,45,44,28,29},t},
[13]={n,f},
[47]={{48,47},t},
[12]={n,f},
[45]={{48,49,45},t},
[57]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,57},t},
[36]={{48,49,45,44,28,29,31,32,33,36},t},
[25]={{48,49,45,44,28,27,26,25},t},
[71]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71},t},
[20]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{48,49,45,44,28,29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{48,49,45,44,28,29,31,32,33,36,37},t},
[2]={n,f},
[35]={{48,49,45,44,28,29,31,32,34,35},t},
[53]={{48,47,52,53},t},
[73]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{48,49,45,44,28,29,31,32,33},t},
[69]={{48,49,45,44,28,29,31,32,34,35,39,41,60,69},t},
[65]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{48,49,45,44,28,27,26},t},
[68]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{48,47,50},t},
[66]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{48,49,45,44,28,27,26,25,24},t},
[23]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{48,49,45,44},t},
[39]={{48,49,45,44,28,29,31,32,34,35,39},t},
[32]={{48,49,45,44,28,29,31,32},t},
[3]={n,f},
[30]={{48,49,45,44,28,29,31,32,34,35,39,41,30},t},
[51]={{48,47,50,51},t},
[18]={n,f},
[67]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61},t},
[55]={{48,47,52,53,54,55},t},
[46]={{48,47,46},t},
[42]={{48,49,45,44,28,29,31,32,34,35,38,42},t},
[40]={{48,49,45,44,28,29,31,32,34,35,40},t},
[52]={{48,47,52},t},
[54]={{48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{48,49,45,44,28,29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{48,49,45,44,28,29,31,32,34,35,38},t},
[28]={{48,49,45,44,28},t},
[5]={n,f},
[64]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
--- Runs embedded commands and replaces them


function Util.RunEmbeddedCommands(dispatcher, str)
	str = encodeCommandEscape(str)

	local results = {}
	-- We need to do this because you can't yield in the gsub function
	for text in str:gmatch("$(%b{})") do
		local doQuotes = true
		local commandString = text:sub(2, #text-1)

		if commandString:match("^{.+}$") then -- Allow double curly for literal replacement
			doQuotes = false
			commandString = commandString:sub(2, #commandString-1)
		end

		results[text] = dispatcher:EvaluateAndRun(commandString)

		if doQuotes and results[text]:find("%s") then
			results[text] = string.format("%q", results[text])
		end
	end

	return decodeCommandEscape(str:gsub("$(%b{})", results))
end
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol


 
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local INFO = script.Parent.Infotainment
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local infomode = script.Parent.infotain.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Windows
--Made by Luckymaxer



Model = script.Parent

Creator = Model:FindFirstChild("Creator")

Enabled = false

if Creator and Creator.Value and Creator.Value.Parent and Creator.Value:IsA("Player") and Creator.Value.Character then
	Player = Creator.Value
	Character = Player.Character
	Humanoid = Character:FindFirstChild("Humanoid")
	if Humanoid and Humanoid.Health > 0 then
		Player.Changed:connect(function(Property)
			if Property == "Parent" and not Player.Parent then
				Model:Destroy()
			end
		end)
		Character.Changed:connect(function(Property)
			if Property == "Parent" and not Character.Parent then
				Model:Destroy()
			end
		end)
		Humanoid.Died:connect(function()
			Model:Destroy()
		end)
		Enabled = true
	end
end

if not Enabled then
	Model:Destroy()
end
--- Creates or finds a hitbox object. Returns an hitbox object
-- @param required object parameter that takes in either a part or a model


function RaycastHitbox.new(object: any?)
	local hitbox: any

	if object and CollectionService:HasTag(object, DEFAULT_COLLECTION_TAG_NAME) then
		hitbox = HitboxData:_FindHitbox(object)
	else
		hitbox = setmetatable({
			RaycastParams = nil,
			DetectionMode = RaycastHitbox.DetectionMode.Default,
			HitboxRaycastPoints = {},
			HitboxPendingRemoval = false,
			HitboxStopTime = 0,
			HitboxObject = object,
			HitboxHitList = {},
			HitboxActive = false,
			Visualizer = SHOW_DEBUG_RAY_LINES,
			DebugLog = SHOW_OUTPUT_MESSAGES,
			SignalType = RaycastHitbox.SignalType.Single,
			OnUpdate = Signal.new(RaycastHitbox.SignalType.Single),
			OnHit = Signal.new(RaycastHitbox.SignalType.Single),
			Tag = DEFAULT_COLLECTION_TAG_NAME,
		}, HitboxData)

		hitbox:_Init()
	end

	return hitbox
end
--[[script.Parent.Examinar.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.ExaminarAberto.Visible == false then
	Saude.Variaveis.Doer.Value = true
	Timer.Barra.Size = UDim2.new(0,0,1,0)
	TS:Create(Timer.Barra, TweenInfo.new(5), {Size =  UDim2.new(1,0,1,0)}):Play()
	wait(5)
	script.Parent.Parent.ExaminarAberto.Visible = true
	script.Parent.Parent.ExaminarAberto.Base.DiagnoseHandler.Disabled = false
	Saude.Variaveis.Doer.Value = false
	end
end)]]




script.Parent.Bandages.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.BandagesAberto.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.OtherAberto.Visible = false
	script.Parent.Parent.MedicineAberto.Visible = false
	script.Parent.Parent.BandagesAberto.Visible = true
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Medicines.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.MedicineAberto.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.OtherAberto.Visible = false
	script.Parent.Parent.MedicineAberto.Visible = true
	script.Parent.Parent.BandagesAberto.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Others.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.OtherAberto.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.OtherAberto.Visible = true
	script.Parent.Parent.MedicineAberto.Visible = false
	script.Parent.Parent.BandagesAberto.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)
--[[ Local functionality ]]

--

local function isDynamicThumbstickEnabled()
	return ThumbstickFrame and ThumbstickFrame.Visible
end

local function enableAutoJump(humanoid)
	if humanoid and isDynamicThumbstickEnabled() then
		local shouldRevert = humanoid.AutoJumpEnabled == false
		shouldRevert = shouldRevert and LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice
		RevertAutoJumpEnabledToFalse = shouldRevert
		humanoid.AutoJumpEnabled = true
	end
end

do
	local function onCharacterAdded(character)	
		for _, child in ipairs(LocalPlayer.Character:GetChildren()) do
			if child:IsA("Tool") then
				ToolEquipped = child
			end
		end
		character.ChildAdded:Connect(function(child)
			if child:IsA("Tool") then
				ToolEquipped = child
			elseif child:IsA("Humanoid") then
				enableAutoJump(child)
			end
		end)
		character.ChildRemoved:Connect(function(child)
			if child:IsA("Tool") then
				if child == ToolEquipped then
					ToolEquipped = nil
				end
			end
		end)
		
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			enableAutoJump(humanoid)
		end
	end
	LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
	if LocalPlayer.Character then
		onCharacterAdded(LocalPlayer.Character)
	end
end
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--[=[
	Same as `andThenCall`, except for `done`.

	Attaches a `done` handler to this Promise that calls the given callback with the predefined arguments.

	@param callback (...: any) -> any
	@param ...? any -- Additional arguments which will be passed to `callback`
	@return Promise
]=]


function Promise.prototype:doneCall(callback, ...)
	assert(isCallable(callback), string.format(ERROR_NON_FUNCTION, "Promise:doneCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end, true)
end
-- enable the viewmodel system


local function enableviewmodel()
	isfirstperson = true
	viewmodel.Parent = workspace.CurrentCamera
	if rigtype == "R15" then
		-- disable character joints, enable viewmodel joints
		rightshoulderclone.Enabled = true
		leftshoulderclone.Enabled = true
		-- disable real shoulders
		leftshoulder.Enabled = false
		rightshoulder.Enabled = false
		--
		rightshoulderclone.Part1 = rarm
		rightshoulderclone.Part0 = faketorso
		rightshoulderclone.Parent = faketorso
		--
		leftshoulderclone.Part1 = larm
		leftshoulderclone.Part0 = faketorso
		leftshoulderclone.Parent = faketorso
		--
		armtransparency = firstperson_arm_transparency
	else
		--
		rightshoulderclone.Enabled = true
		leftshoulderclone.Enabled = true
		-- disable real shoulders
		leftshoulder.Enabled = false
		rightshoulder.Enabled = false
		--
		rightshoulderclone.Part1 = rarm
		rightshoulderclone.Part0 = faketorso
		rightshoulderclone.Parent = faketorso
		--
		leftshoulderclone.Part1 = larm
		leftshoulderclone.Part0 = faketorso
		leftshoulderclone.Parent = faketorso
		--
		armtransparency = firstperson_arm_transparency
	end
end
--		print("Keyframe : ".. frameName)	


		playToolAnimation(toolAnimName, 0.0, Enemy)
	end
end


function playToolAnimation(animName, transitionTime, humanoid)	 
		
		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
-- Public Functions



function TeamManager:ClearTeamScores()
	for _, team in ipairs(Teams:GetTeams()) do
		TeamScores[team] = 0
		DisplayManager:UpdateScore(team, 0)
	end
end

function TeamManager:HasTeamWon()
	for _, team in ipairs(Teams:GetTeams()) do
		if TeamScores[team] >= Configurations.MainGameConfig["Captures To Win"] then
			return team
		end
	end
	return false
end

function TeamManager:GetWinningTeam()
	local highestScore = 0
	local winningTeam = nil
	for _, team in ipairs(Teams:GetTeams()) do
		if TeamScores[team] > highestScore then
			highestScore = TeamScores[team]
			winningTeam = team
			for i, winningPlayer in ipairs(TeamPlayers[winningTeam]) do
				winningPlayer.leaderstats.Cash.Value += 100
			end
		end
	end
	return winningTeam
end

function TeamManager:AreTeamsTied()
	local teams = Teams:GetTeams()
	local highestScore = 0
	local tied = false
	for _, team in ipairs(teams) do
		if TeamScores[team] == highestScore then
			tied = true
		elseif TeamScores[team] > highestScore then
			tied = false
			highestScore = TeamScores[team]
		end
	end
	return tied
end

function TeamManager:AssignPlayerToTeam(player)
	local smallestTeam
	local lowestCount = math.huge
	for team, playerList in pairs(TeamPlayers) do
		if #playerList < lowestCount then
			smallestTeam = team
			lowestCount = #playerList
		end
	end
	table.insert(TeamPlayers[smallestTeam], player)
	player.Neutral = false
	player.TeamColor = smallestTeam.TeamColor
end

function TeamManager:RemovePlayer(player)
	local team = GetTeamFromColor(player.TeamColor)
	local teamTable = TeamPlayers[team]
	for i = 1, #teamTable do
		if teamTable[i] == player then
			table.remove(teamTable, i)
			return
		end
	end
end

function TeamManager:ShuffleTeams()
	for _, team in ipairs(Teams:GetTeams()) do
		TeamPlayers[team] = {}
	end
	local players = Players:GetPlayers()
	while #players > 0 do
		local rIndex = math.random(1, #players)
		local player = table.remove(players, rIndex)
		TeamManager:AssignPlayerToTeam(player)
	end
end

function TeamManager:AddTeamScore(teamColor, score)
	local team = GetTeamFromColor(teamColor)
	TeamScores[team] = TeamScores[team] + score
	DisplayManager:UpdateScore(team, TeamScores[team])
end

return TeamManager
--[[
	Constructs a new ForPairs object which maps pairs of a table using
	a `processor` function.

	Optionally, a `destructor` function can be specified for cleaning up values.
	If omitted, the default cleanup function will be used instead.

	Additionally, a `meta` table/value can optionally be returned to pass data created
	when running the processor to the destructor when the created object is cleaned up.
]]



local Dependencies = require(script.Parent.Parent.Dependencies)
local utility = Dependencies.utility

local class = {}

local CLASS_METATABLE = { __index = class }
-- declarations



local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0
-- Removes `i` from `t`. Also sets `Index` field in removed value.


local function remove(t,i)
	local v = t[i]
	for n = i+1,#t do
		local v = t[n]
		v.Index = n-1
		t[n-1] = v
	end
	t[#t] = nil
	v.Index = 0
	return v
end
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= true			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]

--
local AdvancedRespawnScript=script;
local Bob=AdvancedRespawnScript.Parent;
local GameDerbis=Game:GetService("Debris");
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local BobHumanoid;
for _,Child in pairs(Bob:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health>0.001 then
BobHumanoid=Child;
end;
end;
local Respawndant=Bob:Clone();
coroutine.resume(coroutine.create(function()
if Bob and BobHumanoid and BobHumanoid:FindFirstChild("Status")and not BobHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=BobHumanoid:FindFirstChild("Status");
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=BobHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game.Workspace);
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=Bob;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
Bob:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if Bob:FindFirstChild("SpawnForceField")then
Bob:FindFirstChild("SpawnForceField"):Destroy();
end;
Bob:MoveTo(Vector3.new(0,115,0));
end;
end));
function Respawn()
Wait(5);
Respawndant.Parent=Bob.Parent;
Respawndant:MakeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
Bob:remove();
end;
BobHumanoid.Died:connect(Respawn);
-- Mimic roblox menu when opened and closed


guiService.MenuClosed:Connect(function()
	if VRService.VREnabled then
		return
	end
	menuOpen = false
	if not IconController.controllerModeEnabled then
		IconController.setTopbarEnabled(IconController.topbarEnabled,false)
	end
end)
guiService.MenuOpened:Connect(function()
	if VRService.VREnabled then
		return
	end
	menuOpen = true
	IconController.setTopbarEnabled(false,false)
end)

bindCamera()