Pinkstack/roblox-luau-corpus-text huggingface dataset:
--// MAIN CODE



torso = character:WaitForChild("HumanoidRootPart")
joint = character:FindFirstChild("RootJoint", true)
baseC1 = joint.C1

cr = coroutine.resume
cc = coroutine.create

local function getangles()
	local side = torso.CFrame.RightVector:Dot(humanoid.MoveDirection)
	local front = torso.CFrame.LookVector:Dot(humanoid.MoveDirection)
	if frontenabled then
		return side, front*frontmultiplier
	else
		return side, 0
	end
end


humanoid.Died:connect(function()
	script.Disabled = true
end)


game:GetService("RunService").Heartbeat:Connect(function()
	local side, front = getangles()
	joint.C1 = joint.C1:Lerp(baseC1 * CFrame.Angles(math.rad(-front*maxtilt*(humanoid.WalkSpeed/8)),0,math.rad(side*maxtilt*(humanoid.WalkSpeed/16))), stiffness/50)
	
	local ctick = tick()
	if humanoid.MoveDirection.Magnitude > 0 then 

		cr(cc(function()
			local bobx = math.cos(ctick * 7.5) * .25
			local boby = math.abs(math.sin(ctick * 7.5)) * .25        

			local bob = Vector3.new(bobx, boby, 0)

			humanoid.CameraOffset = humanoid.CameraOffset:lerp(bob, .25)
		end))




	else 
		humanoid.CameraOffset = humanoid.CameraOffset * .75
	end
end)
--[[ Script Variables ]]

--
while not Players.LocalPlayer do
	wait()
end
local LocalPlayer = Players.LocalPlayer
local CachedHumanoid = nil
local IsFollowStick = true
local ThumbstickFrame = nil
local MoveTouchObject = nil
local OnTouchEnded = nil		-- defined in Create()
local OnTouchMovedCn = nil
local OnTouchEndedCn = nil
--Cause: Dried Capacitors Losing Charge


while true do
if script.Parent.Parent.Sound.Sound.PlaybackSpeed > 0.95 then
tone = ((((script.Parent.Parent.Sound.Sound.PlaybackSpeed*4/script.Divisor.Value*script.Multiplier.Value)*script.Speed.Value)*2)/10000)
script.Parent.Parent.Sound.Sound.PlaybackSpeed = script.Parent.Parent.Sound.Sound.PlaybackSpeed + tone
script.Parent.Parent.Sound.Sound2.PlaybackSpeed = script.Parent.Parent.Sound.Sound2.PlaybackSpeed + tone
wait()
else
wait(math.random(5,30))
end
wait()
end
--// 스크립트 \\--



while wait(0.2) do
	for _,v in pairs(Main:GetChildren()) do
		if v:isA("Part") then
			Found = false
			local hitbox = Region3.new(v.Position - (v.Size/2), v.Position + (v.Size/2))
			local Char = Player.Character or Player.CharacterAdded:Wait()
			local list = workspace:FindPartsInRegion3WithWhiteList(hitbox, Char:GetDescendants())
			
			for _, Filter in pairs(list) do
				if Filter:FindFirstAncestor(Player.Name) then
					Found = true
					break
				else
					Found = false
				end
			end
			if Found == true then
				for _,v in pairs(Main:WaitForChild(v.Name.."Music"):GetChildren()) do
					if v:isA("Sound") and v.IsPlaying == false then
						v:Play()
						break
					end
				end
			else
				for _,v in pairs(Main:WaitForChild(v.Name.."Music"):GetChildren()) do
					if v:isA("Sound") then
						v:Stop()
					end
				end
			end
		end
	end
end
--Loop For Making Rays For The Bullet's Trajectory


for i = 1, 30 do
	--print("Travelling")
	local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
	local travelRay = Ray.new(point1,thisOffset)
	
	acceptable = false
	while not acceptable do
		hit, position = workspace:FindPartOnRayWithIgnoreList(travelRay, ignoreList)
		if hit then
			--print(hit.Name)
			if hit.Name == "FakeTrack" or hit.Name == "Flash" then
				ignoreList[#ignoreList+1] = hit
				--print("Un-Acceptable")
			else
				--print("Acceptable")
				acceptable = true
			end
		else
			--print("Acceptable")
			acceptable = true
		end
	end

	local distance 		= (position - point1).magnitude
	round.Size			= Vector3.new(0.6, distance, 0.6)
	round.CFrame		= CFrame.new(position, point1)
							* CFrame.new(0, 0, -distance/2)
							* CFrame.Angles(math.rad(90),0,0)
	round.Parent		= Workspace
	point1				= point1 + thisOffset
	
	allied = false
	if hit and hit.Parent then --if we hit something
		
		--print("Bullet Hit Something")
			
		if hit.Parent.Parent then --look if what we hit is a tank
			tank = hit.Parent.Parent:findFirstChild("Tank")
			
			if not tank and hit.Parent.Parent.Parent then
				tank = hit.Parent.Parent.Parent:findFirstChild("Tank")
					
				if not tank and hit.Parent.Parent.Parent.Parent then
					local tank = hit.Parent.Parent.Parent.Parent:findFirstChild("Tank")
					
					if not tank and hit.Parent.Parent.Parent.Parent.Parent then
						local tank = hit.Parent.Parent.Parent.Parent.Parent:findFirstChild("Tank")
					end
				end
			end
		end
			
		if tank then --if it is a tank
			--print("Hit a Tank")
			if tank.Value == BrickColor.new("Bright red") then --if we hit an ally
				allied = true
				--print("Tank is an ally")
			end
		end
	
		if not allied then
			round:remove()
			local e = Instance.new("Explosion")
			e.BlastRadius = 3
			e.BlastPressure = 1700
			e.ExplosionType = Enum.ExplosionType.NoCraters
			e.DestroyJointRadiusPercent = 1.3
			e.Position = position
			e.Parent = Workspace
			local impactPos = CFrame.new(point1,point1 + thisOffset)-point1+position
			for angle = 1, 360, 40 do
				ray(angle,1.5, impactPos)
				ray(angle,3, impactPos)
				--wait()
			end
			round:remove()
			break
		elseif hit and allied then
			round:remove()
			break
		end
	end
	wait()
end

if round then
	round:remove()
end

script:remove()
--		playToolAnimation("toolnone", toolTransitionTime, Humanoid)


		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid)
		return
	end
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		stopAllAnimations()
		moveSit()
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
-- Regeneration


function regenHealth()
	if Regening then return end
	Regening = true
	
	while Humanoid.Health < Humanoid.MaxHealth do
		local waiting = wait(1)
		local health = Humanoid.Health
		if health > 0 and health < Humanoid.MaxHealth then
			local newHealthDelta = 0.01 * waiting * Humanoid.MaxHealth
			health = health + newHealthDelta
			Humanoid.Health = math.min(health,Humanoid.MaxHealth)
		end
	end
	
	if Humanoid.Health > Humanoid.MaxHealth then
		Humanoid.Health = Humanoid.MaxHealth
	end
	
	Regening = false
end

Humanoid.HealthChanged:connect(regenHealth)
--DevelopmentStatus



Seagull = script.Parent
RunService = game:GetService("RunService")

Torso = Seagull:WaitForChild("Body")
LeftWing = Seagull:WaitForChild("LeftWing")
RightWing = Seagull:WaitForChild("RightWing")

LeftMotor = Torso:WaitForChild("LeftMotor")
RightMotor = Torso:WaitForChild("RightMotor")
-----------------
--| Constants |--
-----------------



local GRAVITY_ACCELERATION = workspace.Gravity

local RELOAD_TIME = 3 -- Seconds until tool can be used again
local ROCKET_SPEED = 2 -- Speed of the projectile

local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
--Give player when buy


player:WaitForChild("BackpackShop").Equipped.Changed:Connect(function()
if character:FindFirstChild("Backpack") then
					character.Backpack:Remove()
					local a = game.ServerStorage.Backpacks[equipped.Value]:Clone()
					a.Name = "Backpack"
					a.Parent = character
			end
		end)
	end)
end)
--Tune


OverheatSpeed = .2 --How fast the car will overheat
CoolingEfficiency = .1 --How fast the car will cool down
RunningTemp = 85 --In degrees

Fan = true --Cooling fan
FanTemp = 100 --At what temperature the cooling fan will activate
FanSpeed = .03
FanVolume = .2

BlowupTemp = 130 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge
--Made by Stickmasterluke



originalgrip=CFrame.new(1, 0, 0, 0, 0.03, 0.02, 0, -0.008, 1, 0, 1, 0.008)	--CFrame.new(0,-1.5,0)*CFrame.Angles(0,math.pi/2,0)
currentgrip=originalgrip

function waitfor(parent,name)
	while true do
		local child=parent:FindFirstChild(name)
		if child~=nil then
			return child
		end
		wait()
	end
end

function spinsword(spintime)
	delay(0,function()
		for i=1, 3 do
			local startspin=tick()
			local endspin=startspin+spintime
			while tick()<endspin do
				script.Parent.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
				wait()
			end
			script.Parent.Grip=currentgrip
			wait(0.2)
		end
	end)
end
--[=[
	@param object any -- Object to remove
	Removes the object from the Trove and cleans it up.

	```lua
	local part = Instance.new("Part")
	trove:Add(part)
	trove:Remove(part)
	```
]=]


function Trove:Remove(object: any): boolean
	local objects = self._objects
	for i,obj in ipairs(objects) do
		if obj[1] == object then
			local n = #objects
			objects[i] = objects[n]
			objects[n] = nil
			self:_cleanupObject(obj[1], obj[2])
			return true
		end
	end
	return false
end
-- Placeholder texture can be any roblox asset link


local initialTexture = ""

local RowCount = 5 
local ColCount = 3
local perImageSpriteCount = RowCount * ColCount
local width = 320
local height = 200
local startIndexOffset = 11

local framesInTotal = 3
assert(numImages * RowCount * ColCount >= framesInTotal)

local animPeriod = 0.3 -- period for the whole animation, in seconds
assert(animPeriod > 0)

local curImageIdx = 0
local curSpriteIdx = 0

local fps = framesInTotal / animPeriod
local accumulatedTime = 0

local function AnimateImageSpriteSheet(dt)
	accumulatedTime = math.fmod(accumulatedTime + dt, animPeriod)
	curSpriteIdx = math.floor(accumulatedTime * fps) + startIndexOffset

	local prevImageIndex = curImageIdx
	curImageIdx = math.floor(curSpriteIdx / perImageSpriteCount)
	if prevImageIndex ~= curImageIdx then
		imageInstance.Image = imageAssetIDs[curImageIdx + 1]
	end

	local localSpriteIndex = curSpriteIdx - curImageIdx * perImageSpriteCount
	local row = math.floor(localSpriteIndex / ColCount)
	local col = localSpriteIndex - row * ColCount
	imageInstance.ImageRectOffset = Vector2.new(col * width, row * height)
end

Animator.Connection = nil

Animator.Init = function()
	Animator.Connection = game:GetService("RunService").RenderStepped:Connect(AnimateImageSpriteSheet)
end

Animator.Stop = function()
	if Animator.Connection then
		imageInstance.Image = initialTexture
		Animator.Connection:Disconnect()
	end
end


return Animator
--[=[
	Provides a debounce function call on an operation.

	@function throttle
	@within throttle
	@param timeoutInSeconds number
	@param func function
	@param throttleConfig? { leading = true; trailing = true; }
	@return function
]=]


local function throttle(timeoutInSeconds, func, throttleConfig)
	assert(type(timeoutInSeconds) == "number", "timeoutInSeconds is not a number")
	assert(type(func) == "function", "func is not a function")

	local throttled = ThrottledFunction.new(timeoutInSeconds, func, throttleConfig)

	return function(...)
		throttled:Call(...)
	end
end

return throttle
--NOTICE: If converting to an AF, uncomment any of the commented codes below



ButtonAlert.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("signal",1)
	ButtonAlert.Click:Play()
end)

ButtonAttack.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("signal",2)
	ButtonAttack.Click:Play()
end)


ButtonFire.ProximityPrompt.Enabled = true
ButtonFire.ProximityPrompt.MaxActivationDistance = 5
ButtonFire.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("fire",1)
	ButtonFire.Click:Play()
end)

ButtonCancel.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("signal",0)
	ButtonCancel.Click:Play()
end)

ButtonTest.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("test")
end)

ButtonTest.ProximityPrompt.TriggerEnded:Connect(function()
	Events:Fire("stoptest")
end)
--[[
	An internal method used by the reconciler to construct a new component
	instance and attach it to the given virtualNode.
]]


function Component:__mount(reconciler, virtualNode)
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentClass, "Invalid use of `__mount`")
		internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #2 to be of type VirtualNode")
	end

	local currentElement = virtualNode.currentElement
	local hostParent = virtualNode.hostParent

	-- Contains all the information that we want to keep from consumers of
	-- Roact, or even other parts of the codebase like the reconciler.
	local internalData = {
		reconciler = reconciler,
		virtualNode = virtualNode,
		componentClass = self,
		lifecyclePhase = ComponentLifecyclePhase.Init,
		pendingState = nil,
	}

	local instance = {
		[Type] = Type.StatefulComponentInstance,
		[InternalData] = internalData,
	}

	setmetatable(instance, self)

	virtualNode.instance = instance

	local props = currentElement.props

	if self.defaultProps ~= nil then
		props = assign({}, self.defaultProps, props)
	end

	instance:__validateProps(props)

	instance.props = props

	local newContext = assign({}, virtualNode.legacyContext)
	instance._context = newContext

	instance.state = assign({}, instance:__getDerivedState(instance.props, {}))

	if instance.init ~= nil then
		instance:init(instance.props)
		assign(instance.state, instance:__getDerivedState(instance.props, instance.state))
	end

	-- It's possible for init() to redefine _context!
	virtualNode.legacyContext = instance._context

	internalData.lifecyclePhase = ComponentLifecyclePhase.Render
	local renderResult = instance:render()

	internalData.lifecyclePhase = ComponentLifecyclePhase.ReconcileChildren
	reconciler.updateVirtualNodeWithRenderResult(virtualNode, hostParent, renderResult)

	if instance.didMount ~= nil then
		internalData.lifecyclePhase = ComponentLifecyclePhase.DidMount
		instance:didMount()
	end

	if internalData.pendingState ~= nil then
		-- __update will handle pendingState, so we don't pass any new element or state
		instance:__update(nil, nil)
	end

	internalData.lifecyclePhase = ComponentLifecyclePhase.Idle
end
-- TODO: Remove when we figure out ContextActionService without sinking keys


local function onShiftInputBegan(inputObject, isProcessed)
	if isProcessed then return end
	if inputObject.UserInputType == Enum.UserInputType.Keyboard and
		(inputObject.KeyCode == Enum.KeyCode.LeftShift or inputObject.KeyCode == Enum.KeyCode.RightShift) then
		--
		mouseLockSwitchFunc()
	end
end

local function enableShiftLock()
	IsShiftLockMode = isShiftLockMode()
	if IsShiftLockMode then
		if ShiftLockIcon then
			ShiftLockIcon.Visible = true
		end
		if IsShiftLocked then
			Mouse.Icon = SHIFT_LOCK_CURSOR
			ShiftLockController.OnShiftLockToggled:Fire()
		end
		if not IsActionBound then
			InputCn = UserInputService.InputBegan:connect(onShiftInputBegan)
			IsActionBound = true
		end
	end
end

GameSettings.Changed:connect(function(property)
	if property == 'ControlMode' then
		if GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch then
			enableShiftLock()
		else
			disableShiftLock()
		end
	elseif property == 'ComputerMovementMode' then
		if GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove then
			disableShiftLock()
		else
			enableShiftLock()
		end
	end
end)

LocalPlayer.Changed:connect(function(property)
	if property == 'DevEnableMouseLock' then
		if LocalPlayer.DevEnableMouseLock then
			enableShiftLock()
		else
			disableShiftLock()
		end
	elseif property == 'DevComputerMovementMode' then
		if LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.ClickToMove or
			LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable then
			--
			disableShiftLock()
		else
			enableShiftLock()
		end
	end
end)

LocalPlayer.CharacterAdded:connect(function(character)
	-- we need to recreate guis on character load
	if not UserInputService.TouchEnabled then
		initialize()
	end
end)
-------------------------


 
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
				if key == "c" then --Camera controls
				        if cam == ("car") then
							Camera.CameraSubject = player.Character.Humanoid
							Camera.CameraType = ("Custom")
							cam = ("freeplr")
							Camera.FieldOfView = 70
							limitButton.Text = "Free Camera"
							wait(3)
							limitButton.Text = ""
						elseif cam == ("freeplr") then
							Camera.CameraSubject = player.Character.Humanoid
							Camera.CameraType = ("Attach")
							cam = ("lockplr")
							Camera.FieldOfView = 45
							limitButton.Text = "FPV Camera"
							wait(3)
							limitButton.Text = ""
				        elseif cam == ("lockplr") then
							Camera.CameraSubject = carSeat
							Camera.CameraType = ("Custom")
							cam = ("car")
							Camera.FieldOfView = 70
							limitButton.Text = "Standard Camera"
							wait(3)
							limitButton.Text = ""
				        end
			end
		end)
--// Bullet Physics


	BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 2500; -- Bullet Speed
	BulletSpread = 0; -- How much spread the bullet has
	
	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds
	
	BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type,x) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		return W	
	end
	
	function ModelWeld(a,b) 
		if a:IsA("BasePart") then
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do 
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b) 
				end
			end
		elseif a:IsA("Model") then 
			for i,v in pairs(a:GetChildren()) do 
				ModelWeld(v,b) 
			end 
		end 
	end
	
	function UnAnchor(a) 
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end
--[[
references:
	https://create.roblox.com/docs/reference/engine/datatypes/Vector3
	https://denisrizov.com/2016/06/02/bezier-curves-unity-package-included/
--]]



local SETTINGS = {
	Debug = false
}

local function lerp(a: Vector3, b: Vector3, t)
	return a:Lerp(b, t)
end

local function newInstance(class, properties)
	local instance = Instance.new(class)
	properties = properties or {}
	for k, v in properties do
		if k ~= "Parent" then
			instance[k] = v
		end
	end
	instance.Parent = properties.Parent
	return instance
end
--Place this button and the model you want to regen in the same model.



model = script.Parent.Parent["Regen"] -- Change "Regen" to the name of your model.
newmodel = model:clone()
enabled = true

function onClicked()
	if enabled then
	enabled = false--Keeps you from regening the model while it's still regening
	script.Parent.BrickColor = BrickColor.new(26)--Turns the button Black to let players know it is disabled
	model:remove()
	wait(0.1) -- This is how long it will take to regen
	model = newmodel:clone()
	model.Parent = script.Parent.Parent
	model:MakeJoints()
	wait(15) -- This is how long it will take for the regen button to be enabled after being used
	script.Parent.BrickColor = BrickColor.new(23)--Turns the button Blue to tell players it is enabled
	enabled = true
	end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[[
	Returns the Plant Id associated with a given Seed Id
--]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")

local getAttribute = require(ReplicatedStorage.Source.Utility.getAttribute)
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)
local getItemByIdInCategory = require(ReplicatedStorage.Source.Utility.Farm.getItemByIdInCategory)
local ItemCategory = require(ReplicatedStorage.Source.SharedConstants.ItemCategory)

local function getPlantIdFromSeedId(seedId: string)
	local seedModel = getItemByIdInCategory(seedId, ItemCategory.Seeds)
	return getAttribute(seedModel, Attribute.PlantId)
end

return getPlantIdFromSeedId
--[[Brakes]]


	Tune.ABSEnabled		= true		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS) 

	Tune.FBrakeForce	= 800		-- Front brake force
	Tune.RBrakeForce	= 1000		-- Rear brake force
	Tune.PBrakeForce	= 2250		-- Handbrake force
	
	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]
--LIGHTING FUNCTIONS



script.Parent.OnServerEvent:connect(function(pl,n) if lt~=1 then pr = true else pr=false end lt=n
	if lt == 0 then
		RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360)
		RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360)
		UpdateLt(1,white)
		UpdatePt(false,white)
		StopMt(pr)
		repeat wait() until lt~=0
	elseif lt == 1 then
		wait(.125)
		RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360)
		RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360)
		UpdateLt(.25,red)
		UpdatePt(true,red)
		UpdateMt(0,math.rad(225),4)
		wait(.75)
		repeat
			UpdateMt(0,math.rad(135),0)
			wait(.5)
			if lt~=1 then break end
			UpdateMt(0,math.rad(225),0)
			wait(.5)
		until lt~=1
	elseif lt == 2 then
		UpdateLt(.25,amber)
		UpdatePt(true,amber)
		UpdateMt(0,9e9,1)
		repeat
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdateLt(.25,red) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdatePt(true,red) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdateLt(.25,amber) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdatePt(true,amber) end
			wait()
		until lt~=2
	elseif lt == 3 then
		wait(1/6)
		UpdateLt(.25,blue)
		UpdatePt(true,blue)
		UpdateMt(0,9e9,1)
		repeat wait() until lt~=3
	end
end)
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================


local function statusChanged()
	local raceStatus = RaceManager:GetRaceStatus()
	GameStatus.Text = raceStatus
	
	-- Hide GUI when round is in session and player is a speeder
	if raceStatus == RaceManager.Status.RoundInProgress then
		StatusBar.Visible = false
	else
		StatusBar.Visible = true
	end
end -- statusChanged()
--                                                     in the mainUI


closeButton.MouseButton1Down:Connect(function()
	topbar_closeButton_p:Play()
	hideMainWindow()
end)

closeButton.MouseButton1Up:Connect(function()
	topbar_closeButton_f:Cancel()
	topbar_closebutton_r:Play()
	topbar_closebutton_r.Completed:Wait()
	topbar_closeButton_nf:Play()
end)
--wait(WaitTime)



local Finished = 0
local AF = 0
for l,i in pairs(Edit) do
AF = AF+1
Spawn(function()
for j, v in pairs(i) do
wait(v[3] and v[3] or 0)
for k = 1, v[2]  do
for m, n in pairs(Parts:GetChildren()) do
if n.Name == l then
-------------------------------------------------------
--Start Important Functions--
-------------------------------------------------------


s.Size = Vector3.new(4, 0.05, 4)
function swait(num)
	if num == 0 or num == nil then
		game:service("RunService").Stepped:wait(0)
	else
		for i = 0, num do
			game:service("RunService").Stepped:wait(0)
		end
	end
end


wait(1)
coroutine.resume(coroutine.create(function()
for i = 1,25 do
swait(0)
s.Size = s.Size - Vector3.new(0.04,0,0.04)
end
s:Destroy()
end))