Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- << LOCAL FUNCTIONS >>


local function checkPrefix(character, pdata)
	local incorrectPrefixes = {
		[":"] = true;
	}
	if main.infoOnAllCommands.Prefixes[character] or character == pdata.Prefix or (settings.WarnIncorrectPrefix and incorrectPrefixes[character]) then --Included the last argument as new players confuse ; with :
		return true
	else
		return false
	end
end
-- do not touch anything below or I will cry ~Wiz --



local nowplaying = ""

local requests = {
}

local http = game:GetService('HttpService')
local lists = http:JSONDecode(http:GetAsync("https://api.trello.com/1/boards/"..trelloboard.."/lists"))
for _,v in pairs(lists) do
	if v.name == "Past" then
		local items = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/"..v.id.."/cards"))
		print(#items)
		for _,v in pairs(items) do
			if v.name:match(":") ~= nil then
				local s,f = string.find(v.name,":")
				table.insert(songs, string.sub(v.name,f+1))	
			end
		end
	end
end

function shuffleTable(t)
	math.randomseed(tick())
	assert(t, "shuffleTable() expected a table, got nil" )
	local iterations = #t
	local j
	for i = iterations, 2, -1 do
		j = math.random(i)
		t[i], t[j] = t[j], t[i]
	end
end

shuffleTable(songs)

local songnum = 0

function script.Parent.musicEvents.getSong.OnServerInvoke()
	return game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name
end

script.Parent.musicEvents.purchaseSong.OnServerEvent:connect(function(p)
	if p.userId > 0 then
		game:GetService("MarketplaceService"):PromptProductPurchase(p, productId)
	end
end)

local votes = {
	
}

function makesong()
	script.Parent.Parent.Parent.Body.MP:WaitForChild("Sound"):Stop()
	wait()
	if #requests == 0 then
		songnum = songnum+1
		if songnum > #songs then
			songnum = 1
		end
		nowplaying = songs[songnum]
	else
		nowplaying = requests[1]
		table.remove(requests,1)
	end
	local thisfunctionssong = nowplaying
	script.Parent.Parent.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..thisfunctionssong
	wait()
	script.Parent.Parent.Parent.Body.MP.Sound:Play()
	script.Parent.musicEvents.newSong:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name)
	votes = {}
	wait(script.Parent.Parent.Parent.Body.MP.Sound.TimeLength)
	if "rbxassetid://"..nowplaying == "rbxassetid://"..thisfunctionssong then
		makesong()
	end
end

function countVotes()
	local c = 0
	for _,v in pairs(votes) do
		if v[2] == true then
			c = c +1
		end
	end
	local remainder = #game.Players:GetPlayers() - #votes
	local percent = (c + (remainder/2))/#game.Players:GetPlayers()
	script.Parent.musicEvents.voteChange:FireAllClients(percent)
	if percent <= 0.2 then
		--skip song
		makesong()
	end
	return
end

script.Parent.musicEvents.voteYes.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = true
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, true})
	countVotes()
end)

script.Parent.musicEvents.voteNo.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = false
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, false})
	countVotes()
end)
--[=[
	@class Option

	Represents an optional value in Lua. This is useful to avoid `nil` bugs, which can
	go silently undetected within code and cause hidden or hard-to-find bugs.
]=]


local Option = {}
Option.__index = Option


function Option._new(value)
	local self = setmetatable({
		ClassName = CLASSNAME;
		_v = value;
		_s = (value ~= nil);
	}, Option)
	return self
end
-- A state object which follows another state object using tweens.


export type Tween<T> = PubTypes.Tween<T> & {
	_goalState: State<T>,
	_tweenInfo: TweenInfo,
	_prevValue: T,
	_nextValue: T,
	_currentValue: T,
	_currentTweenInfo: TweenInfo,
	_currentTweenDuration: number,
	_currentTweenStartTime: number
}
--[[
	Various ragdoll constraints that are used depending on what type
	of joint they're being applied to. 
	
	This is meant to work with any character, but is mostly tailored 
	to characters with legs/arms, as it is impossible to satisfy all 
	use cases in a generic way. You	can for sure make a spider with 8 
	legs by sticking to the same naming conventions as R15 
	(e.g. LeftUpperLeg1, 2, 3, ...), but something like an eel is not 
	going to come for free out of the box, at least	perfectly. That said, 
	there is a Default waist-like joint for all unknown	joint types. It 
	won't be perfect, but it will be functional. 
	
	If these joint types do not satisfy your use cases, you can tweak them
	or add new ones! Just modify or add to this module's children. These
	constraints are automatically selected based on the last word of the
	joint's name (e.g. Hip from LeftHip). Things to know if you are 
	changing them:
	
	Shoulder twist angles should not be lowered any further or the ragdoll's
	arms will get stuck	in "Aliens" position often
	https://i.imgur.com/Ck5j34M.jpg
	
	Neck is using a HingeConstraint because BallSocketConstraints are 
	kind of	unstable for the head.
	https://gfycat.com/GrotesqueFirsthandBluebottlejellyfish
	
	Ankle and Wrist are HingeConstraints because twist limits are not
	enough for BallSocketConstraints -- due to the "try to do x"
	rather than "force x" nature of constraints, twist limits are
	given a small margin where they are not applied close to 0, and
	this causes the wrists/ankles to jitter back and forth when they 
	are suspended in air. Other limbs are generally not suspended in
	air, so it's only necessary for Ankle/Wrist joints.
--]]


	
local getLastWordFromPascaleCase = require(script.Parent:WaitForChild("getLastWordFromPascalCase"))

local constraints = {}
for _,v in pairs(script:GetChildren()) do
	constraints[v.Name] = v
end

function getConstraintTemplate(jointName)
	jointName = getLastWordFromPascaleCase(jointName)
	return constraints[jointName] or constraints.Default
end

function createConstraint(jointData)
	local jointName = jointData.Joint.Name
	local constraint = getConstraintTemplate(jointName):Clone()
	
	constraint.Attachment0 = jointData.Attachment0
	constraint.Attachment1 = jointData.Attachment1
	constraint.Name = jointName.."RagdollConstraint"
	
	-- Constraints don't work if there is a rigid joint connecting its two parts,
	-- so when we enter ragdoll we need to turn off the joint, and turn it back on
	-- when we leave ragdoll. This allows us to tell which joint corresponds with
	-- which constraint
	local rigidPointer = Instance.new("ObjectValue")
	rigidPointer.Parent = constraint
	rigidPointer.Name = "RigidJoint"
	rigidPointer.Value = jointData.Joint
	
	return constraint
end

return function(attachmentMap)
	local ragdollConstraints = Instance.new("Folder")
	ragdollConstraints.Name = "RagdollConstraints"

	for _,jointData in pairs(attachmentMap) do
		if jointData.Joint.Name ~= "Root" then
			local ragdollConstraint = createConstraint(jointData)
			ragdollConstraint.Parent = ragdollConstraints
		end
	end
	
	return ragdollConstraints
end
--[=[
	@param ... any

	Same as `Fire`, but uses `task.defer` internally & doesn't take advantage of thread reuse.
	```lua
	signal:FireDeferred("Hello")
	```
]=]


function Signal:FireDeferred(...)
	local item = self._handlerListHead
	while item do
		task.defer(item._fn, ...)
		item = item._next
	end
end
--This module is for any client FX related to the lab debris



local DoorFX = {}

local tweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)



local InitialModelCFrames = {}

function DoorFX.OPEN(door)
	if not door then return end
	
	local EffectsBrick = door:WaitForChild("Effects")
	local Effects = EffectsBrick:GetChildren()

	for _, Item in pairs (Effects) do
		if Item.Name == "Unlock" then Item:Play() continue end
		if Item:IsA("Beam") or Item:IsA("PointLight") or Item:IsA("ParticleEmitter") then
			Item.Enabled = true
		end
	end

	local Components = door:GetChildren()
	for _, Component in pairs (Components) do
		if not Component:IsA("Model") then continue end

		local descendants = Component:GetDescendants()
		for _, item in pairs (descendants) do
			if item:IsA("BasePart") and item ~= Component.PrimaryPart then
				local newWeld = Instance.new("WeldConstraint")
				newWeld.Part0 = item
				newWeld.Part1 = Component.PrimaryPart
				newWeld.Parent = Component.PrimaryPart
				item.Anchored = false
			end
		end

		InitialModelCFrames[Component] = Component.PrimaryPart.CFrame

		local CFrameGoal = (Component.PrimaryPart.CFrame + Vector3.new(math.random(-1,1),3,math.random(-1,1))) 
			* CFrame.Angles(math.rad(math.random(1,360)), math.rad(math.random(1,360)), math.rad(math.random(1,360)))
	
		local TweenInf = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.In)
		tweenService:Create(Component.PrimaryPart, TweenInf, {CFrame = CFrameGoal}):Play()
	end

	wait(1)

	for _, Component in pairs (Components) do
		if not Component:IsA("Model") then continue end

		local CFrameGoal = (Component.PrimaryPart.CFrame + Vector3.new(math.random(-20,20),50,math.random(-20,20))) 
			* CFrame.Angles(math.rad(math.random(1,360)), math.rad(math.random(1,360)), math.rad(math.random(1,360)))
	
		local TweenInf = TweenInfo.new(2, Enum.EasingStyle.Linear)
		local Tween = tweenService:Create(Component.PrimaryPart, TweenInf, {CFrame = CFrameGoal})
		Tween:Play()
		local Event = nil
		Event = Tween.Completed:Connect(function()
			Event:Disconnect()
			Component.PrimaryPart.CFrame = Component.PrimaryPart.CFrame - Vector3.new(0, 300, 0)		
		end)
	end

	wait(.5)

	for _, Item in pairs (Effects) do
		if Item:IsA("Beam") or Item:IsA("PointLight") or Item:IsA("ParticleEmitter") then
			Item.Enabled = false
		end
	end

end

function DoorFX.CLOSE(door)
	if not door then return end

	local Components = door:GetChildren()
	for _, Component in pairs (Components) do
		if Component:IsA("Model") then
			Component.PrimaryPart.CFrame = InitialModelCFrames[Component] or Component.PrimaryPart.CFrame 
			--this errors when the module is called for some reason so thats why its like that
		end
	end
end

return DoorFX
---



MakeWeld(car.Misc.Und.base,car.DriveSeat)

MakeWeld(car.Misc.Und.Cover.A,car.Misc.Und.Cover.part1)

MakeWeld(car.Misc.Und.La.A,car.Misc.Und.La.part1)

MakeWeld(car.Misc.Und.H1.To,car.Misc.Und.H1.part1)
MakeWeld(car.Misc.Und.H1.H2.To,car.Misc.Und.H1.H2.part1)
MakeWeld(car.Misc.Und.H1.H2.H3.To,car.Misc.Und.H1.H2.H3.part1)
MakeWeld(car.Misc.Und.H1.H2.H3.H4.Ua_1,car.Misc.Und.H1.H2.H3.H4.part1)
MakeWeld(car.Misc.Und.H1.H2.H3.H4.Ua_2,car.Misc.Und.H1.H2.H3.H4.part1)
MakeWeld(car.Misc.Und.H1.H2.H3.H4.Ua_3,car.Misc.Und.H1.H2.H3.H4.part1)

MakeWeld(car.Misc.Und.H1.part0,car.Misc.Und.H1.part1,"Motor",.003).Name="Motor"
MakeWeld(car.Misc.Und.H1.H2.part0,car.Misc.Und.H1.H2.part1,"Motor",.006).Name="Motor"
MakeWeld(car.Misc.Und.H1.H2.H3.part0,car.Misc.Und.H1.H2.H3.part1,"Motor",.003).Name="Motor"
MakeWeld(car.Misc.Und.H1.H2.H3.H4.part0,car.Misc.Und.H1.H2.H3.H4.part1,"Motor",.006).Name="Motor"

MakeWeld(car.Misc.Und.Cover.part0,car.Misc.Und.Cover.part1,"Motor",.015).Name="Motor"
MakeWeld(car.Misc.Und.La.part0,car.Misc.Und.La.part1,"Motor",.003).Name="Motor"


MakeWeld(car.Misc.Und.H1.part0,car.Misc.Und.base)

MakeWeld(car.Misc.Und.Cover.part0,car.Misc.Und.base)

MakeWeld(car.Misc.Und.La.part0,car.Misc.Und.base)

MakeWeld(car.Misc.Und.H1.H2.part0,car.Misc.Und.H1.To)

MakeWeld(car.Misc.Und.H1.H2.H3.part0,car.Misc.Und.H1.H2.To)

MakeWeld(car.Misc.Und.H1.H2.H3.H4.part0,car.Misc.Und.H1.H2.H3.To)

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
	end
end)
-- Menus


local menuContainer = Instance.new("Frame")
menuContainer.Active = true
menuContainer.Selectable = false
menuContainer.Name = "MenuContainer"
menuContainer.BackgroundTransparency = 1
menuContainer.BorderSizePixel = 0
menuContainer.AnchorPoint = Vector2.new(1, 0)
menuContainer.Size = UDim2.new(0, 500, 0, 50)
menuContainer.ZIndex = -2
menuContainer.ClipsDescendants = true
menuContainer.Visible = true
menuContainer.Parent = iconContainer
menuContainer.Active = false

local menuFrame = Instance.new("ScrollingFrame")
menuFrame.Active = true
menuFrame.Selectable = true
menuFrame.Name = "MenuFrame"
menuFrame.BackgroundTransparency = 1
menuFrame.BorderSizePixel = 0
menuFrame.AnchorPoint = Vector2.new(0, 0)
menuFrame.Position = UDim2.new(0, 0, 0, 0)
menuFrame.Size = UDim2.new(1, 0, 1, 0)
menuFrame.ZIndex = -1 + 10
menuFrame.ClipsDescendants = false
menuFrame.Visible = true
menuFrame.TopImage = ""--menuFrame.MidImage
menuFrame.BottomImage = ""--menuFrame.MidImage
menuFrame.HorizontalScrollBarInset = Enum.ScrollBarInset.Always
menuFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
menuFrame.Parent = menuContainer
menuFrame.Active = false

local menuList = Instance.new("UIListLayout")
menuList.Name = "MenuList"
menuList.FillDirection = Enum.FillDirection.Horizontal
menuList.HorizontalAlignment = Enum.HorizontalAlignment.Right
menuList.SortOrder = Enum.SortOrder.LayoutOrder
menuList.Parent = menuFrame

local menuInvisBlocker = Instance.new("Frame")
menuInvisBlocker.Name = "MenuInvisBlocker"
menuInvisBlocker.BackgroundTransparency = 1
menuInvisBlocker.Size = UDim2.new(0, -2, 1, 0)
menuInvisBlocker.Visible = true
menuInvisBlocker.LayoutOrder = 999999999
menuInvisBlocker.Parent = menuFrame
menuInvisBlocker.Active = false
-- Folder


local soundFold = rp.Storage.Sounds

local module = {}

function module.Play( Data)
	local sfx = Data.sfx
	local tim = Data.tim 
	local part = Data.part
	
	local sound = sfx:Clone()
	sound.Parent = part
	sound:Play()
	if tim then
		game.Debris:AddItem(sound, tim)
	end
	
	return sound
end
--// # key, ManOn


mouse.KeyDown:connect(function(key)
	if key=="f" then 
		veh.Lightbar.middle.Man:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
	end
end)
--[[Engine]]

--
	
	-- Everything below can be illustrated and tuned with the graph below.
	-- https://www.desmos.com/calculator/x1h2vdccu1
	-- This includes everything, from the engines, to boost, to electric.
	
	-- Naturally Aspirated Engine
	Tune.Engine 		= true		
		
		Tune.IdleRPM		= 950
		Tune.Redline		= 10000
		Tune.PeakRPM		= 9000
		-- Horsepower
		Tune.Horsepower		= 65
		Tune.MH_PeakRPM		= Tune.PeakRPM
		Tune.MH_PeakSharp	= 2
		Tune.MH_CurveMult	= 0.02
		-- Torque
		Tune.M_EqPoint		= 8500
		Tune.MT_PeakRPM		= 11000
		Tune.MT_PeakSharp	= 5
		Tune.MT_CurveMult	= 0.5
	
	-- Electric Engine
	Tune.Electric		= false
		
		Tune.E_Redline	= 16000
		Tune.E_Trans1	= 4000
		Tune.E_Trans2	= 9000
		-- Horsepower
		Tune.E_Horsepower	= 223
		Tune.EH_FrontMult	= 0.15
		Tune.EH_EndMult		= 2.9
		Tune.EH_EndPercent	= 7
		-- Torque
		Tune.E_Torque		= 223
		Tune.ET_EndMult		= 1.505
		Tune.ET_EndPercent	= 27.5
		
	-- Turbocharger
	Tune.Turbochargers	= 1				-- Number of turbochargers in the engine
										-- Set to 0 for no turbochargers
		Tune.T_Boost		= 12
		Tune.T_Efficiency	= 6
		--Horsepower
		Tune.TH_PeakSharp	= 4
		Tune.TH_CurveMult	= 0.12
		--Torque
		Tune.TT_PeakSharp	= 4
		Tune.TT_CurveMult	= 0.12
		
		Tune.T_Size			= 20		-- Turbo Size; Bigger size = more turbo lag
		
	-- Supercharger
	Tune.Superchargers	= 0				-- Number of superchargers in the engine
										-- Set to 0 for no superchargers
		Tune.S_Boost		= 5
		Tune.S_Efficiency	= 6
		--Horsepower
		Tune.SH_PeakSharp	= 2
		Tune.SH_CurveMult	= 0.02
		--Torque
		Tune.ST_PeakSharp	= 2
		Tune.ST_CurveMult	= 0.02
		
		Tune.S_Sensitivity	= 0.05		-- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)
	
	--Misc
	Tune.RevAccel		= 250		-- 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.Flywheel		= 500		-- Flywheel weight (higher = faster response, lower = more stable RPM)

    Tune.InclineComp	= 2.8
	--Aero
	Tune.Drag			= 0.5		-- 0 to 1, edit to change drag effect (0 = no effect, 1 = full effect)
-- Defina a propriedade "AngularVelocity" em todos os motores CylindricalConstraint


local function setMotorVelocity(vel)
	motorFL.AngularVelocity = vel
	motorBL.AngularVelocity = vel
	-- Os motores do lado direito estão voltados para a direção oposta, portanto, a velocidade negativa deve ser usada
	motorFR.AngularVelocity = -vel
	motorBR.AngularVelocity = -vel
end
--Casts a ray to find the height for the character to hover at even if the path is going up or down


function findHeight(distanceInFront)
	local torso = character.HumanoidRootPart
	local ray = Ray.new(
    Vector3.new(torso.Position.X, torso.Position.Y + 50, torso.Position.Z - distanceInFront), 	-- origin
    (Vector3.new(0, -1, 0)).Unit * 300)	 														-- direction
	local ignore = character
	local hit, position = game.Workspace:FindPartOnRay(ray, ignore)
	return position.Y + 40
end

function highest(tableOfValues)
	local highestSoFar = tableOfValues[1]
	for i = 2, #tableOfValues do
		if tableOfValues[i] > highestSoFar then
			highestSoFar = tableOfValues[i]
		end
	end
	return highestSoFar
end

function fastStart()
	if started == false then	
		started = true
		local fastStartPosition = Instance.new("BodyPosition")
		fastStartPosition.Name = "FastStart"
		fastStartPosition.maxForce = Vector3.new(0, 15000, 0)
		fastStartPosition.Parent = character.HumanoidRootPart
		local fastStartVelocity = Instance.new("BodyVelocity")
		fastStartVelocity.maxForce = Vector3.new(0, 0, 15000)
		fastStartVelocity.velocity = Vector3.new(0, 0, -150)
		fastStartVelocity.Parent = character.HumanoidRootPart
		fastStartPosition.position = Vector3.new(0, highest({findHeight(0), findHeight(10), findHeight(20), findHeight(30)}), 0)
		while character.HumanoidRootPart.Position.Z > spawnLocation.Z - 1000 do
			wait(1)
			if character:FindFirstChild("HumanoidRootPart") == nil then
				break
			end
			fastStartPosition.position = Vector3.new(0, highest({findHeight(0), findHeight(10), findHeight(20), findHeight(30)}), 0)
		end
		fastStartVelocity.velocity = Vector3.new(0, 0, 0)
		wait(2)
		if character:FindFirstChild("HumanoidRootPart") then
			fastStartPosition:Destroy()
			fastStartVelocity:Destroy()
			local shield = Instance.new("ForceField")
			shield.Name = "Shield"		
			shield.Parent = character
			game:GetService("Debris"):AddItem(shield, 3)
		end
		fastStart:Destroy()
		script:Destroy()
	end
end

fastStart() --Script starts disabled, only enabled when a player starts running
-- VR only supports 1st person or 3rd person and no overrides


function VRBaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance: number): number
	local lastSubjectDistance = self.currentSubjectDistance

	local newSubjectDistance = math.clamp(desiredSubjectDistance, 0, player.CameraMaxZoomDistance)
	if newSubjectDistance < 1.0 then
		self.currentSubjectDistance = 0.5
		if not self.inFirstPerson then
			self:EnterFirstPerson()
		end
	else
		self.currentSubjectDistance = newSubjectDistance
		if self.inFirstPerson then
			self:LeaveFirstPerson()
		end
	end

	-- Pass target distance and zoom direction to the zoom controller
	ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))

	-- Returned only for convenience to the caller to know the outcome
	return self.currentSubjectDistance
end
--[[ The Module ]]

--
local BaseCamera = require(script.Parent:WaitForChild("BaseCamera"))
local ClassicCamera = setmetatable({}, BaseCamera)
ClassicCamera.__index = ClassicCamera

function ClassicCamera.new()
	local self = setmetatable(BaseCamera.new(), ClassicCamera)

	self.isFollowCamera = false
	self.lastUpdate = tick()

	return self
end

function ClassicCamera:GetModuleName()
	return "ClassicCamera"
end
--- Same as indexing, but uses an incremented number as a key.
-- @param task An item to clean
-- @treturn number taskId


function Maid:GiveTask(task)
	assert(task, "Task cannot be false or nil")

	local taskId = #self._tasks+1
	self[taskId] = task

	if type(task) == "table" and (not task.Destroy) then
		warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
	end

	return taskId
end

function Maid:GivePromise(promise)
	if not promise:IsPending() then
		return promise
	end

	local newPromise = promise.resolved(promise)
	local id = self:GiveTask(newPromise)

	-- Ensure GC
	newPromise:Finally(function()
		self[id] = nil
	end)

	return newPromise
end
--Feel free to change other properties


trail.Parent = script.Parent.HumanoidRootPart
att0.Parent = script.Parent.HumanoidRootPart
att1.Parent = script.Parent.HumanoidRootPart
trail.Attachment0 = att0
trail.Attachment1 = att1
trail.Enabled = true
trail.Color = ColorSequence.new(Color3.new(1, 0, 1), Color3.new(1, 1, 0))
att0.Position = Vector3.new(.5, 0, 0)
att1.Position = Vector3.new(-.5, 0, 0)
--print("Cutscene should start now")


for i=1,#cutsceneinfo:GetChildren(),1 do
	camera.CFrame = cutsceneinfo:FindFirstChild("Position"..i).Value
	--print("Reached Position "..i)
	if i ~= #cutsceneinfo:GetChildren() then
		--Theres more coming, play a tween to the next position
		local tweentime = cutsceneinfo:FindFirstChild("Position"..i+1).Time.Value
		local easingstyle = EasingStyles[cutsceneinfo:FindFirstChild("Position"..i+1).EasingStyle.Value]
		local easingdirection = EasingDirections[cutsceneinfo:FindFirstChild("Position"..i+1).EasingDirection.Value]
		local cf = cutsceneinfo:FindFirstChild("Position"..i+1).Value
		game.TweenService:Create(camera,TweenInfo.new(tweentime,easingstyle,easingdirection),{CFrame=cf}):Play()
		wait(tweentime)
	else
		--The cutscene is over. Don't do anything after this point
	end
end

game.Workspace.CurrentCamera.CameraType = currentcameramode
game.Debris:AddItem(script)