Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[ FUNCTION ]-



function updateMusic()
	local id = string.gsub(music.SoundId, "rbxassetid://", "")
	local success, info = pcall(mps.GetProductInfo, mps, id)
	if success then
		Frame:TweenPosition(UDim2.new(0.288, 0, 0.026, 0),"Out","Quad",.5,true) -- changing it to in
		script.Parent.Text = "Now Playing : " .. info.Name -- changing name

		wait(5) -- wait to close it

		Frame:TweenPosition(UDim2.new(0.288, 0,-1, 0),"In","Quad",.5,true) -- changing it to in
	end
end


updateMusic()


music:GetPropertyChangedSignal("SoundId"):Connect(updateMusic)
-- ROBLOX TODO: Object here is a stand-in for Map and Set, use those when we extract type-only files


return function<T, U>(value: string | Array<T> | Object, mapFn: (mapFn<T, U> | mapFnWithThisArg<T, U>)?, thisArg: Object?): Array<U>
	if not Set then
		Set = (require(LuauPolyfill).Set :: any)
	end

	if not Map then
		Map = (require(LuauPolyfill).Map :: any)
	end

	if value == nil then
		error("cannot create array from a nil value")
	end
	local valueType = typeof(value)

	local array = {}

	if valueType == "table" and isArray(value) then
		if mapFn then
			for i = 1, #(value :: Array<T>) do
				if thisArg ~= nil then
					array[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, (value :: Array<T>)[i], i)
				else
					array[i] = (mapFn :: mapFn<T, U>)((value :: Array<T>)[i], i)
				end
			end
		else
			for i = 1, #(value :: Array<T>) do
				array[i] = (value :: Array<any>)[i]
			end
		end
	elseif instanceof(value, Set) then
		if mapFn then
			for i, v in (value :: any):ipairs() do
				if thisArg ~= nil then
					array[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, v, i)
				else
					array[i] = (mapFn :: mapFn<T, U>)(v, i)
				end
			end
		else
			for i, v in (value :: any):ipairs() do
				array[i] = v
			end
		end
	elseif instanceof(value, Map) then
		if mapFn then
			for i, v in (value :: any):ipairs() do
				if thisArg ~= nil then
					array[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, v, i)
				else
					array[i] = (mapFn :: mapFn<T, U>)(v, i)
				end
			end
		else
			for i, v in (value :: any):ipairs() do
				array[i] = v
			end
		end
	elseif valueType == "string" then
		if mapFn then
			for i = 1, (value :: string):len() do
				if thisArg ~= nil then
					array[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, (value :: any):sub(i, i), i)
				else
					array[i] = (mapFn :: mapFn<T, U>)((value :: any):sub(i, i), i)
				end
			end
		else
			for i = 1, (value :: string):len() do
				array[i] = (value :: any):sub(i, i)
			end
		end
	end

	return array
end
-- Probably a bit unorthodox, but hey, it works



DefaultX = 1304
Causes = 534

local Change = script.Parent.Parent
local LastChange = tick()

function Size()
	repeat wait() until Change.Parent.AbsoluteSize.X ~= 0
	LastChange = tick()
	local ResolutionX = Change.Parent.AbsoluteSize.X
	local x = ResolutionX / DefaultX
	local z = x * Causes
	local y = z / Causes

	local Percentage = Change.AbsoluteSize.X / ResolutionX
	script.Parent.Scale = y
end

Change.Changed:connect(function()
	if tick() - LastChange > 0.1 then
		Size()
	end
end)

Size()
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --


This.Floor.Position = UDim2.new(0.25,0,0,0)
This.Direction.Text = ">"
wait(0.25)
This.Direction.Text = "->"
wait(0.25)
This.Direction.Text = "-->"
wait(0.25)
This.Direction.Text = "<"
wait(0.25)
This.Direction.Text = "<-"
wait(0.25)
This.Direction.Text = "<--"
wait(0.25)
This.Direction.Text = "SYSTEM READY"
wait(5)
This.Floor.Position = UDim2.new(0.125,0,0,0)
This.Direction.Text = ""
while wait() do
	if Lift:WaitForChild("Direction").Value ~= 0 then 
		if Lift:WaitForChild("Velocity").Value == 0 then
			if Lift:WaitForChild("Direction").Value == 1 then
				This.Floor.Position = UDim2.new(0.25,0,0,0)
				This.Direction.Text = "-->"
			else
				This.Floor.Position = UDim2.new(0.25,0,0,0)
				This.Direction.Text = "<--"
			end
		elseif Lift:WaitForChild("Velocity").Value ~= 0 then
			if Lift:WaitForChild("Direction").Value == 1 then
				This.Floor.Position = UDim2.new(0.25,0,0,0)
				This.Direction.Text = ">"
				wait(0.25)
				This.Direction.Text = "->"
				wait(0.25)
				This.Direction.Text = "-->"
				wait(0.25)
			else
				This.Floor.Position = UDim2.new(0.25,0,0,0)
				This.Direction.Text = "<"
				wait(0.25)
				This.Direction.Text = "<-"
				wait(0.25)
				This.Direction.Text = "<--"
				wait(0.25)
			end
		end
	else
		This.Floor.Position = UDim2.new(0.125,0,0,0)
		This.Direction.Text = ""
	end
end
--Rescripted by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Sounds = {
	CoilSound = Handle:WaitForChild("CoilSound"),
}

Gravity = 196.20
JumpHeightPercentage = 0.25

ToolEquipped = false

function GetAllConnectedParts(Object)
	local Parts = {}
	local function GetConnectedParts(Object)
		for i, v in pairs(Object:GetConnectedParts()) do
			local Ignore = false
			for ii, vv in pairs(Parts) do
				if v == vv then
					Ignore = true
				end
			end
			if not Ignore then
				table.insert(Parts, v)
				GetConnectedParts(v)
			end
		end
	end
	GetConnectedParts(Object)
	return Parts
end

function SetGravityEffect()
	if not GravityEffect or not GravityEffect.Parent then
		GravityEffect = Instance.new("BodyForce")
		GravityEffect.Name = "GravityCoilEffect"
		GravityEffect.Parent = Torso
	end
	local TotalMass = 0
	local ConnectedParts = GetAllConnectedParts(Torso)
	for i, v in pairs(ConnectedParts) do
		if v:IsA("BasePart") then
			TotalMass = (TotalMass + v:GetMass())
		end
	end
	local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
	GravityEffect.force = Vector3.new(0, TotalMass, 0)
end

function HandleGravityEffect(Enabled)
	if not CheckIfAlive() then
		return
	end
	for i, v in pairs(Torso:GetChildren()) do
		if v:IsA("BodyForce") then
			v:Destroy()
		end
	end
	for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
		if v then
			v:disconnect()
		end
	end
	if Enabled then
		CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		SetGravityEffect()
		DescendantAdded = Character.DescendantAdded:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
		DescendantRemoving = Character.DescendantRemoving:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
	end
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HumanoidDied = Humanoid.Died:connect(function()
		if GravityEffect and GravityEffect.Parent then
			GravityEffect:Destroy()
		end
	end)
	Sounds.CoilSound:Play()
	HandleGravityEffect(true)
	ToolEquipped = true
end

function Unequipped()
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HandleGravityEffect(false)
	ToolEquipped = false
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
----- Initialize -----



if IsStudio == true then
	IsLiveCheckActive = true
	task.spawn(function()
		local status, message = pcall(function()
			-- This will error if current instance has no Studio API access:
			DataStoreService:GetDataStore("____PS"):SetAsync("____PS", os.time())
		end)
		local no_internet_access = status == false and string.find(message, "ConnectFail", 1, true) ~= nil
		if no_internet_access == true then
			warn("[ProfileService]: No internet access - check your network connection")
		end
		if status == false and
			(string.find(message, "403", 1, true) ~= nil or -- Cannot write to DataStore from studio if API access is not enabled
				string.find(message, "must publish", 1, true) ~= nil or -- Game must be published to access live keys
				no_internet_access == true) then -- No internet access

			UseMockDataStore = true
			ProfileService._use_mock_data_store = true
			print("[ProfileService]: Roblox API services unavailable - data will not be saved")
		else
			--print("[ProfileService]: Roblox API services available - data will be saved")
		end
		IsLiveCheckActive = false
	end)
end
-- # CODE BELOW # --
-- ^    Do not change anything else



local GoreFolder = game.ReplicatedStorage["Gore by Leveled Development"];
local Core = require(GoreFolder.Modules.Core);

local Character = script.Parent.Parent;

function Load()
	local Humanoid = Character:FindFirstChild("Humanoid");
	repeat wait() until Humanoid;

	local NewDescription = Humanoid:GetAppliedDescription();
	NewDescription.Head = 0;
	NewDescription.LeftArm = 0;
	NewDescription.RightArm = 0;
	NewDescription.LeftLeg = 0;
	NewDescription.RightLeg = 0;
	NewDescription.Torso = 0;
	Humanoid:ApplyDescription(NewDescription);
end;

Load();
Character.Humanoid.Died:Connect(function()
	delay(game:GetService("Players").RespawnTime, function()
		Load();
	end);
end);
-- Fonction pour afficher l'écran GUI lors de la connexion d'un joueur


local function showGUI(player)
	-- Vérifier si le joueur est déjà mort (pour éviter l'affichage du GUI lorsqu'il réapparaît)
	local character = player.Character
	if character and character:FindFirstChild("Humanoid") and character.Humanoid.Health <= 0 then
		return
	end

	-- Cloner l'objet GUI et l'attacher au joueur
	local playerGui = player:WaitForChild("PlayerGui")
	local clonedGUI = gui:Clone()
	clonedGUI.Parent = playerGui
end
-- Etc


local DESTROY_ON_DEATH = getValueFromConfig("DestroyOnDeath")
local RAGDOLL_ENABLED = getValueFromConfig("RagdollEnabled")

local DEATH_DESTROY_DELAY = 5
local PATROL_WALKSPEED = 16
local MIN_REPOSITION_TIME = 2
local MAX_REPOSITION_TIME = 10
local MAX_PARTS_PER_HEARTBEAT = 50
local ATTACK_STAND_TIME = 1
local HITBOX_SIZE = Vector3.new(5, 3, 4)
local SEARCH_DELAY = 1
local ATTACK_RANGE = 3
local ATTACK_DELAY = 1
local ATTACK_MIN_WALKSPEED = 15
local ATTACK_MAX_WALKSPEED = 15
--------------------------------------------------------------------------



local _WHEELTUNE = {
																		--[[	
			SS6 Presets
	[Eco]		
		WearSpeed = 1,
		TargetFriction = .7,
		MinFriction = .1,
	[Road]		
		WearSpeed = 2,
		TargetFriction = .7,
		MinFriction = .1,
	[Sport]		
		WearSpeed = 3,
		TargetFriction = .79,
		MinFriction = .1,											]]

	TireWearOn 		= false	,
	
	--Friction and Wear
	FWearSpeed		= 1 	,
	FTargetFriction	= 2.5	,
	FMinFriction 	= 2.25	,
	
	RWearSpeed		= 1 	,
	RTargetFriction	= 2.75	,
	RMinFriction	= 2.5	,
	
	--Tire Slip
	TCSOffRatio		= 1/3	,
	WheelLockRatio	= 1/2	,	--SS6 Default = 1/4
	WheelspinRatio	= 1/1.1	,	--SS6 Default = 1/1.2
	
	--Wheel Properties
	FFrictionWeight	= 1		,	--SS6 Default = 1
	RFrictionWeight	= 1		,	--SS6 Default = 1
	FLgcyFrWeight	= 10	,
	RLgcyFrWeight	= 10	,
	
	FElasticity		= .5		,	--SS6 Default = .5
	RElasticity		= .5		,	--SS6 Default = .5
	FLgcyElasticity	= 0		,
	RLgcyElasticity	= 0		,
	
	FElastWeight	= 1		,	--SS6 Default = 1
	RElastWeight	= 1		,	--SS6 Default = 1
	FLgcyElWeight	= 10	,
	RLgcyElWeight	= 10	,
	
	--Wear Regen
	RegenSpeed		= 3.6		--SS6 Default = 3.6
}
-- functions



return function(position, radius)
	local explosion		= script.Explosion:Clone()
		explosion.CFrame	= CFrame.new(position)
		explosion.Parent	= EFFECTS
		
	explosion.FlashEmitter.Size	= NumberSequence.new(radius * 2, 0)
	explosion.FlashEmitter:Emit(3)
	
	explosion.PointLight.Range	= radius
	local lightInfo		= TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
	local lightTween	= TweenService:Create(explosion.PointLight, lightInfo, {Range = 0})
	lightTween:Play()
	
	for i = 1, 10 do
		local meteor	= script.Meteor:Clone()
			meteor.CFrame	= CFrame.new(position)
			meteor.Parent	= EFFECTS
			meteor.Velocity	= Vector3.new(math.random(-50, 50), math.random(40, 80), math.random(-50, 50)) * math.random(10, 20) / 10
			
		Debris:AddItem(meteor, 6)
	end
	
	explosion["ExplosionSound" .. tostring(math.random(10))]:Play()
	explosion.SmokeEmitter:Emit(15)
	explosion.FireEmitter:Emit(30)
	
	local range		= radius * 5
	local distance	= (CAMERA.CFrame.p - position).Magnitude
	
	if distance < range then
		local amount	= 1 - (distance / range)
		local direction	= CAMERA.CFrame:vectorToObjectSpace((CAMERA.CFrame.p - position).Unit)
		EVENTS.Shake:Fire(direction * 100 * amount)
	end
	
	Debris:AddItem(explosion, 10)
end
--Setup script (It's automatic, you don't need to edit)


local MODEL = script.Parent

local CONFIG = MODEL.Configuration
local CAMERA1 = MODEL.Camera1
local CAMERA2 = MODEL.Camera2
local TRIGGER = MODEL.CutscenePart
local SCRIPT = MODEL.CutsceneScript

CONFIG.Parent = SCRIPT
CAMERA1.Parent = workspace
CAMERA1.Transparency = 1
CAMERA2.Parent = workspace
CAMERA2.Transparency = 1
TRIGGER.Parent = workspace
SCRIPT.Parent = game.StarterPlayer.StarterPlayerScripts
MODEL:Destroy()
--Directly taken from roblox's page



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

local SOURCE_LOCALE = "en"
local translator = nil

local AnimateUI = {}

function AnimateUI.loadTranslator()
	pcall(function()
		translator = LocalizationService:GetTranslatorForPlayerAsync(Players.LocalPlayer)
	end)
	if not translator then
		pcall(function()
			translator = LocalizationService:GetTranslatorForLocaleAsync(SOURCE_LOCALE)
		end)
	end
end

function AnimateUI.typeWrite(guiObject, text, delayBetweenChars)
	guiObject.Visible = true
	guiObject.AutoLocalize = false
	local displayText = text
	
	-- Translate text if possible
	if translator then
		displayText = translator:Translate(guiObject, text)
	end
	
	-- Replace line break tags so grapheme loop will not miss those characters
	displayText = displayText:gsub("<br%s*/>", "\n")
	displayText:gsub("<[^<>]->", "")
	
	-- Set translated/modified text on parent
	guiObject.Text = displayText
	
	local index = 0
	for _,_ in utf8.graphemes(displayText) do
		index += 1
		guiObject.MaxVisibleGraphemes = index
		task.wait(delayBetweenChars)
	end
end

return AnimateUI
--Made by Stickmasterluke




local tool = script.Parent


local firerate = 1
local range = 200


local handle = tool:WaitForChild("Handle")
local event = tool:WaitForChild("RemoteEvent")
local firesound = handle:WaitForChild("FireSound")


local check = true


function checkintangible(hit)
	if hit and hit~=nil then
		if hit:IsDescendantOf(tool.Parent) or hit.Transparency>.8 or hit.Name=="Handle" or string.lower(string.sub(hit.Name,1,6))=="effect" then
			return true
		end
	end
	return false
end

function castray(startpos, vec, length, ignore, delayifhit)
	local hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos ,vec * length), ignore)
	if hit~=nil then
		if checkintangible(hit) then
			hit, endpos2 = castray(endpos2+(vec*.01),vec,length-((startpos-endpos2).magnitude),ignore,delayifhit)
		end
	end
	return hit,endpos2
end


tool.Equipped:connect(function(mouse)
	equipped = true
	if mouse then
		mouse.Icon = "rbxasset://textures\\GunCursor.png"
		mouse.Button1Down:connect(function()
			local humanoid = tool.Parent:FindFirstChild("Humanoid")
			local head = tool.Parent:FindFirstChild("Head")
			local torso = tool.Parent:FindFirstChild("Torso")
			if check and humanoid and humanoid.Health > 0 and head and torso then
				check = false
				mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
				
				firesound:Play()

				local vec = (mouse.Hit.p - head.Position).unit
				local hit ,endpos = castray(head.Position, vec, range, tool.Parent)

				event:FireServer("Fire", endpos, hit)

				wait(firerate)
				if mouse then
					mouse.Icon = "rbxasset://textures\\GunCursor.png"
				end
				check = true
			end
		end)
	end
end)

tool.Unequipped:connect(function()
	equipped = false
end)
--[[
	Change is used to generate special prop keys that can be used to connect to
	GetPropertyChangedSignal.

	Generally, Change is indexed by a Roblox property name:

		Roact.createElement("TextBox", {
			[Roact.Change.Text] = function(rbx)
				print("The TextBox", rbx, "changed text to", rbx.Text)
			end,
		})
]]



local Type = require(script.Parent.Parent.Type)

local Change = {}

local changeMetatable = {
	__tostring = function(self)
		return ("RoactHostChangeEvent(%s)"):format(self.name)
	end,
}

setmetatable(Change, {
	__index = function(self, propertyName)
		local changeListener = {
			[Type] = Type.HostChangeEvent,
			name = propertyName,
		}

		setmetatable(changeListener, changeMetatable)
		Change[propertyName] = changeListener

		return changeListener
	end,
})

return Change
--- Runs hooks matching name and returns nil for ok or a string for cancellation


function Dispatcher:RunHooks(hookName, ...)
	if not self.Registry.Hooks[hookName] then
		error(("Invalid hook name: %q"):format(hookName), 2)
	end

	for _, hook in ipairs(self.Registry.Hooks[hookName]) do
		local value = hook.callback(...)

		if value ~= nil then
			return tostring(value)
		end
	end
end

function Dispatcher:PushHistory(text)
	assert(RunService:IsClient(), "PushHistory may only be used from the client.")

	local history = self:GetHistory()

	-- Remove duplicates
	if Util.TrimString(text) == "" or text == history[#history] then
		return
	end

	history[#history + 1] = text

	TeleportService:SetTeleportSetting(HISTORY_SETTING_NAME, history)
end

function Dispatcher:GetHistory()
	assert(RunService:IsClient(), "GetHistory may only be used from the client.")

	return TeleportService:GetTeleportSetting(HISTORY_SETTING_NAME) or {}
end

return function (cmdr)
	Dispatcher.Cmdr = cmdr
	Dispatcher.Registry = cmdr.Registry

	return Dispatcher
end
--Smoothlerp for lua. "Zeno would be proud!"
--Use it in a feedback loop over multiple frames to converge A towards B, in a deltaTime safe way
--eg:  cameraPos = SmoothLerp(cameraPos, target, 0.5, deltaTime)
--Handles numbers and types that implement Lerp like Vector3 and CFrame



function MathUtils:SmoothLerp(variableA, variableB, fraction, deltaTime)

    local f = 1.0 - math.pow(1.0 - fraction, deltaTime)

    if (type(variableA) == "number") then
        return ((1-f) * variableA) + (variableB * f)
    end

    return variableA:Lerp(variableB, f)
end

return MathUtils
-- Constants


local DEBUG = false								-- Whether or not to use debugging features of FastCast, such as cast visualization.
local BULLET_SPEED = 1000							-- Studs/second - the speed of the bullet
local BULLET_MAXDIST = 1000							-- The furthest distance the bullet can travel 
local BULLET_GRAVITY = Vector3.new(0, 0, 0)		-- The amount of gravity applied to the bullet in world space (so yes, you can have sideways gravity)
local MIN_BULLET_SPREAD_ANGLE = 1					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The least accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. Generally you want to keep this at 0 so there's at least some chance of a 100% accurate shot.
local MAX_BULLET_SPREAD_ANGLE = 1					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The most accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. This cannot be less than the value above. A value of 90 will allow the gun to shoot sideways at most, and a value of 180 will allow the gun to shoot backwards at most. Exceeding 180 will not add any more angular varience.
local FIRE_DELAY = .3								-- The amount of time that must pass after firing the gun before we can fire again.
local BULLETS_PER_SHOT = 1							-- The amount of bullets to fire every shot. Make this greater than 1 for a shotgun effect.
local PIERCE_DEMO = false							-- True if the pierce demo should be used. See the CanRayPierce function for more info.
--right


local tween1r = TweenService:Create(Part1R, Tweeninformation, goals1r)
local tween2r = TweenService:Create(Part2R, Tweeninformation, goals2r)
local tween3r = TweenService:Create(Part3R, Tweeninformation, goals3r)
local tween4r = TweenService:Create(Part4R, Tweeninformation, goals4r)
local tween5r = TweenService:Create(Part5R, Tweeninformation, goals5r)
local tween6r = TweenService:Create(Part6R, Tweeninformation, goals6r)
local tween7r = TweenService:Create(Part7R, Tweeninformation, goals7r)
local tween8r = TweenService:Create(Part8R, Tweeninformation, goals8r)

button.MouseClick:Connect(function()
	tween1l:Play()
	tween2l:Play()
	tween3l:Play()
	tween4l:Play()
	tween5l:Play()
	tween6l:Play()
	tween7l:Play()
	tween8l:Play()

	tween1r:Play()
	tween2r:Play()
	tween3r:Play()
	tween4r:Play()
	tween5r:Play()
	tween6r:Play()
	tween7r:Play()
	tween8r:Play()
end)
---------------------------------------------------



local tweenService = game:GetService("TweenService")
This = script.Parent
Lift = This.Parent.Parent.Parent
CustomLabel = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

for i,v in pairs(Lift.Car:WaitForChild("Welds"):GetChildren()) do
	if v.Part1 == script.Parent.Light then v:Destroy() end
end
local weld = Instance.new("ManualWeld", This.Button)
weld.C0 = Lift.Car.Platform.CFrame:inverse() * This.Light.CFrame
weld.Part0 = Lift.Car.Platform
weld.Part1 = This.Light
click = false

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetLabel(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetLabel(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetLabel(ID,CHAR)
	if This.Label:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do 
			This.Label["DIG"..ID].Mesh.MeshId = "rbxassetid://"..l
		end
	end
end

ChangeFloor(This.Name)

for x,x in pairs(This.Button:GetChildren()) do 
	if x:IsA("SurfaceGui") and x.Name == ("Button") then 
		x.Button.MouseButton1Click:connect(function()
			if click == false then
				click = true
				tweenService:Create(weld,TweenInfo.new(0.1),{
					["C1"] = weld.C1*CFrame.new(0, 0, -0.002),
				}):Play()
				wait(0.1)
				tweenService:Create(weld,TweenInfo.new(0.1),{
					["C1"] = weld.C1*CFrame.new(0, 0, 0.002),
				}):Play()
				wait(0.1)
				click = false
			end
		end)
	end
end
--[[
	HOW TO SETUP:

	1 - Enable Datastores if you want the stages to save when you leave.
		Don't know how? Search up 'Enabling Datastores Roblox'

	2 - Copy and paste the part in Checkpoints for each additional checkpoint.
			Make sure you change the number to whatever checkpoint it is
	
	3 - Configure the settings below and you're done!
--]]



local SaveData = true -- Do you want your stages to save? (true,false)
local DataName = "Room" -- Set to the name of your stats.
--[[
	Returns the amount of centiseconds as human readable with specified format. The format contains "$" preceding a time division to be readable by the formatter. 
	For example, getFromCentiseconds(20000, "$minutesm $secondss") returns "3m 20s"
]]


function ReadableTime.getFromCentiseconds(centiseconds, format)
	local divisions = getTimeDivisions(centiseconds)

	return getTimeString(divisions, format)
end

return ReadableTime
-- References
--local standardBulletModel = game:GetService("ReplicatedStorage").Projectiles.Standard



setmetatable(weaponTemplate, weaponBase)

function weaponTemplate.new(isClient, weaponModel, weaponType, projectileModel, isAutomatic, fireRate, miniGunSpoolTime, coneSpread)
	local newWeapon = weaponBase.new(isClient, weaponModel, weaponType, projectileModel, isAutomatic, fireRate, coneSpread)
	setmetatable(newWeapon, weaponTemplate)

	print(newWeapon.coneSpread)
	
	newWeapon.isFiring = false
	newWeapon.spoolTimer = timer.new(miniGunSpoolTime, function() newWeapon.isFiring = true  end, true)
	

	
	-- Send client weapon details so they can construct it on the client.
	if not isClient then
		currency = require(game:GetService("ServerScriptService").Managers.Currency)
		setClientWeaponContext_RE:FireClient(newWeapon.ownerPlayer, newWeapon)
		newWeapon.rewardTimer = timer.new(1, function() currency.AddPower(newWeapon.ownerPlayer.UserId,5) end, newWeapon.isAutomatic)
	end
	
	return newWeapon
end