Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Initialize the tool


local CollisionTool = {
	Name = 'Collision Tool';
	Color = BrickColor.new 'Really black';
}

CollisionTool.ManualText = [[<font face="GothamBlack" size="16">Collision Tool  🛠</font>
Lets you change whether parts collide with one another.<font size="6"><br /></font>

<b>TIP:</b> Press <b>Enter</b> to toggle collision quickly.]]
--[[Transmission]]


	Tune.TransModes		= {"Semi"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 4.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		4.5		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[
	Sets the current index of the surface art.
]]


modules.setCurrentIndex = function(self)
	return function(index, offset)
		if self.isAnimating then
			return
		end

		-- Can't figure out the right way to do this - we can only calculate how much to move
		-- the frame using the images rendered within this frame, not the entire rendered indexes Frame
		local target = constants.SurfaceArtSelectorItemSize * offset

		self.updateTarget(target)
		self.targetIndex = self.formatTargetIndex(index, offset)

		task.spawn(function()
			self:setState({ offset = math.abs(offset) })
			self.isAnimating = true
			self.motor:setGoal(Otter.spring(target, { frequency = 3 }))
			task.wait(0.5)
			self.isAnimating = false
			self:setState({ selectedIndex = index, offset = 0 })
			self.motor:setGoal(Otter.instant(0))
		end)
	end
end
--[[
	Main RenderStep Update. The camera controller and occlusion module both have opportunities
	to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera.
	The camera and occlusion modules should only return CFrames, not set the CFrame property of
	CurrentCamera directly.
--]]


function CameraModule:Update(dt)
	if self.activeCameraController then
		self.activeCameraController:UpdateMouseBehavior()

		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)

		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end

		-- Here is where the new CFrame and Focus are set for this render frame
		local currentCamera = game.Workspace.CurrentCamera :: Camera
		currentCamera.CFrame = newCameraCFrame
		currentCamera.Focus = newCameraFocus

		if CameraInput.getInputEnabled() then
			CameraInput.resetInputForFrameEnd()
		end
	end
end
-- Fade out


for _,Part in pairs(script.Parent:GetDescendants()) do
	if Part:IsA("BasePart") then
		game:GetService("TweenService"):Create(Part, TweenInfo.new(1), {Transparency = 1}):Play()
	elseif Part:IsA("TextLabel") then
		game:GetService("TweenService"):Create(Part, TweenInfo.new(1), {TextTransparency = 1}):Play()
		game:GetService("TweenService"):Create(Part, TweenInfo.new(1), {TextStrokeTransparency = 1}):Play()
	end
end
task.wait(1)
script.Parent:Destroy()
-- THIS SCRIPT STAYS UNDISABLED


local Players = game:GetService("Players")
local LobbySpawn =  workspace.Lobby.Spawn.CFrame -- Your Spawn Location CFrame
local VotingREFolder = game.ReplicatedStorage.VotingRE
local Winners = {}
	VotingREFolder.Transition:FireAllClients()

	for _,  player in pairs (Players:GetPlayers()) do  
	if player.InGame.Value == true then
			player.leaderstats.Wins.Value += 1
			player.Character.HumanoidRootPart.CFrame = LobbySpawn
			table.insert(Winners, player.Name)
			print(Winners)
			player.InGame.Value = false
	else
		print("No Players!")
		end
	end	

	for _, child in pairs(workspace:GetChildren()) do
		if child:IsA("Model") and child:FindFirstChild("SpawnPoints") then
			child:Destroy()
		end
	end

	VotingREFolder.RoundFinished:FireAllClients(Winners)

	wait(3) -- Transition wait
	wait(18) -- Winners Announce Wait


	Winners = {}

script.Parent.PlayerCount:Destroy()

script.Parent.Disabled = false
script.Disabled = true
-- [Head, Torso, HumanoidRootPart], "Torso" and "UpperTorso" works with both R6 and R15.
-- Also make sure to not misspell it.


local PartToLookAt = "Head" -- What should the npc look at. If player doesn't has the specific part it'll looks for RootPart instead.

local LookBackOnNil = false -- Should the npc look at back straight when player is out of range.

local SearchLoc = {workspace} -- Will get player from these locations
--[[ Public API ]]

--
function MasterControl:Init()
	RunService:BindToRenderStep("MasterControlStep", Enum.RenderPriority.Input.Value, updateMovement)
end

function MasterControl:Enable()
	areControlsEnabled = true
	isJumpEnabled = true
	
	if self.ControlState.Current then
		self.ControlState.Current:Enable()
	end
end

function MasterControl:Disable()
	
	if self.ControlState.Current then
		self.ControlState.Current:Disable()
	end
	
	--After current control state is disabled, moveValue has been set to zero,
	--Call updateMovement one last time to make sure this propagates to the engine -
	--Otherwise if disabled while humanoid is moving, humanoid won't stop moving.
	updateMovement()
	
	isJumping = false
	areControlsEnabled = false
end

function MasterControl:EnableJump()
	isJumpEnabled = true
	if areControlsEnabled and self.ControlState:IsTouchJumpModuleUsed() then
		self.TouchJumpModule:Enable()
	end
end

function MasterControl:DisableJump()
	isJumpEnabled = false
	if self.ControlState:IsTouchJumpModuleUsed() then
		self.TouchJumpModule:Disable()
	end
end

function MasterControl:AddToPlayerMovement(playerMoveVector)
	moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, moveValue.Z + playerMoveVector.Z)
end

function MasterControl:GetMoveVector()
	return moveValue
end

function MasterControl:SetIsJumping(jumping)
	if not isJumpEnabled then return end
	isJumping = jumping
	local humanoid = self:GetHumanoid()
	if humanoid and not humanoid.PlatformStand then
		humanoid.Jump = isJumping
	end
end

function MasterControl:DoJump()
	if not isJumpEnabled then return end
	local humanoid = self:GetHumanoid()
	if humanoid then
		humanoid.Jump = true
	end
end

return MasterControl
--Precalculated paths


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


repeat wait() until Player.Character

Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.CamPart.CFrame

script.Parent.Enabled = true

 local MasterControl = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"))

 MasterControl:Disable()
--Keypress function--


function Handler(BindName, InputState)
	if InputState == Enum.UserInputState.Begin and BindName == 'RunBind' then
		Running = true
		Humanoid.WalkSpeed = RunningSpeed
		T:Play()
	elseif InputState == Enum.UserInputState.End and BindName == 'RunBind' then
		Running = false
		if RAnimation.IsPlaying then
			RAnimation:Stop()
		end
		Humanoid.WalkSpeed = NormalSpeed
		rT:Play()
	end
end
-- shut down the script when we die and reset things


humanoid.Died:Connect(function()
	stepped_con:Disconnect()
	leftshoulderclone:Destroy()
	rightshoulderclone:Destroy()
	viewmodel:Destroy()
	if rigtype == "R15" then
		if torso:FindFirstChild("Waist") then
			torso.Waist.Enabled = true
			torso.Anchored = false
		end
		armtransparency = 0
		visiblearms(false)
	else
		if rightshoulder then
			rightshoulder.Enabled = true
		end
		if leftshoulder then
			leftshoulder.Enabled = true
		end
		larm.Anchored = false
		rarm.Anchored = false
		armtransparency = 0
		visiblearms(false)
	end
end)
--[[Function]]

--
script.Parent.MouseButton1Click:connect(function()
	if game.Workspace[script.Parent.Parent.billboardText.Text].Head:findFirstChild("BillboardGui") then game.Workspace[script.Parent.Parent.billboardText.Text].Head:findFirstChild("BillboardGui"):Destroy() end
		wait(1)
		local f = Instance.new("TextLabel")
		local b = Instance.new("BillboardGui")
		f.Parent = b
		b.Parent = game.Workspace[script.Parent.Parent.billboardText.Text].Head
		f.Size = UDim2.new(0.5, 0, 0.5, 0)
		b.Size = UDim2.new(5, 0, 5, 0)
		b.StudsOffset = Vector3.new(0, 0, 0)
		b.ExtentsOffset = Vector3.new(1, 0.5, 0)
		f.Text = script.Parent.Parent.billboardTarget.Text
		f.TextColor3 = Color3.new(83, 255, 255)
		f.FontSize = Enum.FontSize.Size10
		f.TextStrokeTransparency = 0
		f.BackgroundTransparency = 1 
		b.AlwaysOnTop = true	
end)
--Made by Luckymaxer



Debris = game:GetService("Debris")

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet"}

Functions = {
	
	FindCharacterAncestor = (function(Object)
		if Object and Object ~= game:GetService("Workspace") then
			local Humanoid = Object:FindFirstChild("Humanoid")
			if Humanoid then
				return Object, Humanoid
			else
				return Functions.FindCharacterAncestor(Object.Parent)
			end
		end
		return nil
	end),

	CheckTableForString = (function(Table, String)
		for i, v in pairs(Table) do
			if string.lower(v) == string.lower(String) then
				return true
			end
		end
		return false
	end),
	
	CheckIntangible = (function(Hit)
		if Hit and Hit.Parent then
			if Functions.CheckTableForString(ProjectileNames, Hit.Name) then
				return true
			end
			local ObjectParent = Hit.Parent
			local Character = ObjectParent.Parent
			local Humanoid = Character:FindFirstChild("Humanoid")
			if Humanoid and Humanoid.Health > 0 and ObjectParent:IsA("Hat") then
				return true
			end
		end
		return false
	end),
	
	CastRay = (function(StartPos, Vec, Length, Ignore, DelayIfHit)
		local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
		if RayHit and Functions.CheckIntangible(RayHit) then
			if DelayIfHit then
				wait()
			end
			RayHit, RayPos, RayNormal = Functions.CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
		end
		return RayHit, RayPos, RayNormal
	end),
	
	IsTeamMate = (function(Player1, Player2)
		return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
	end),
	
	TagHumanoid = (function(humanoid, player)
		local Creator_Tag = Create("ObjectValue"){
			Name = "creator",
			Value = player,
		}
		Debris:AddItem(Creator_Tag, 2)
		Creator_Tag.Parent = humanoid
	end),
	
	UntagHumanoid = (function(humanoid)
		for i, v in pairs(humanoid:GetChildren()) do
			if v:IsA("ObjectValue") and v.Name == "creator" then
				v:Destroy()
			end
		end
	end),
	
	CheckTableForString = (function(Table, String)
		for i, v in pairs(Table) do
			if string.lower(v) == string.lower(String) then
				return true
			end
		end
		return false
	end),
	
	Clamp = (function(Number, Min, Max)
		return math.max(math.min(Max, Number), Min)
	end),
	
	GetPercentage = (function(Start, End, Number)
		return (((Number - Start) / (End - Start)) * 100)
	end),
	
	Round = (function(Number, RoundDecimal)
		local WholeNumber, Decimal = math.modf(Number)
		return ((Decimal >= RoundDecimal and math.ceil(Number)) or (Decimal < RoundDecimal and math.floor(Number)))
	end),
	
}

return Functions
--[[
	Saved profile structure:
	
	DataStoreProfile = {
		Data = {},
		MetaData = {
			ProfileCreateTime = 0,
			SessionLoadCount = 0,
			ActiveSession = {place_id, game_job_id} / nil,
			ForceLoadSession = {place_id, game_job_id} / nil,
			MetaTags = {},
			LastUpdate = 0, -- os.time()
		},
		RobloxMetaData = {},
		UserIds = {},
		GlobalUpdates = {
			update_index,
			{
				{update_id, version_id, update_locked, update_data},
				...
			}
		},
	}
	
	OR
	
	DataStoreProfile = {
		GlobalUpdates = {
			update_index,
			{
				{update_id, version_id, update_locked, update_data},
				...
			}
		},
	}
--]]
-- KEY SETTINGS


local Headlights = Enum.KeyCode.U

local RunningLights = Enum.KeyCode.N

local FogLights = Enum.KeyCode.J

local SignalLeft = Enum.KeyCode.Z

local SignalRight = Enum.KeyCode.C

local Hazards = Enum.KeyCode.X

local Popups = Enum.KeyCode.B

local Flash = Enum.KeyCode.L
------------------------------------------------------------------------------------------------------------------------------------------------------------



local Button = script.Parent.Parent.Mobile.Runs

function runss()
	if Button.ImageTransparency == 0.5
	then 
		
		character.Humanoid.WalkSpeed = NewWalkSpeed
		sprinting = true
		while power > 0 and sprinting do
			power = power - .03
			Bar.Size = UDim2.new(power / 10, 0, 1, 0)
			--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 42, 42), 0.001)
			tween:Play()
			wait()
			if power <= 0 then
				character.Humanoid.WalkSpeed = NormalWalkSpeed
			end
		end
		
		Button.ImageTransparency = 0
	elseif Button.ImageTransparency == 0
	then 
		
		character.Humanoid.WalkSpeed = NormalWalkSpeed
		sprinting = false
		while power < 10 and not sprinting do
			power = power + .03
			Bar.Size = UDim2.new(power / 10, 0, 1, 0)
			--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 166, 11), 0.001)
			tween2:Play()
			wait()
			if power <= 0 then
				character.Humanoid.WalkSpeed = NormalWalkSpeed
			end
		end
		
		Button.ImageTransparency = 0.5
	end
end

Button.MouseButton1Click:connect(runss)
--Left Legs


local LUL = character.LowerTorso:FindFirstChild("LeftHipRigAttachment")
local LULRig = character.LeftUpperLeg:FindFirstChild("LeftHipRigAttachment")
local LLL = character.LeftUpperLeg:FindFirstChild("LeftKneeRigAttachment")
local LLLRig = character.LeftLowerLeg:FindFirstChild("LeftKneeRigAttachment")
local LF = character.LeftLowerLeg:FindFirstChild("LeftAnkleRigAttachment")
local LFRig = character.LeftFoot:FindFirstChild("LeftAnkleRigAttachment")
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.



local FFlagFixChatWindowHoverOver = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixChatWindowHoverOver")
	end)
	if ok then
		FFlagFixChatWindowHoverOver = value
	end
end

local FFlagFixMouseCapture = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixMouseCapture")
	end)
	if ok then
		FFlagFixMouseCapture = value
	end
end

local FFlagUserHandleChatHotKeyWithContextActionService = false do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService")
	end)
	if ok then
		FFlagUserHandleChatHotKeyWithContextActionService = value
	end
end

local FILTER_MESSAGE_TIMEOUT = 60

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local ContextActionService = game:GetService("ContextActionService")

local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end

local FFlagUserChatNewMessageLengthCheck2 do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserChatNewMessageLengthCheck2")
	end)
	FFlagUserChatNewMessageLengthCheck2 = success and result
end

local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
	OnNewMessage = "RemoteEvent",
	OnMessageDoneFiltering = "RemoteEvent",
	OnNewSystemMessage = "RemoteEvent",
	OnChannelJoined = "RemoteEvent",
	OnChannelLeft = "RemoteEvent",
	OnMuted = "RemoteEvent",
	OnUnmuted = "RemoteEvent",
	OnMainChannelSet = "RemoteEvent",

	SayMessageRequest = "RemoteEvent",
	GetInitDataRequest = "RemoteFunction",
}
--[[
	Constructs ragdoll constraints and flags some limbs so they can't collide with each other
	for stability purposes. After this is finished, it tags the humanoid so the client/server
	ragdoll scripts can listen to StateChanged and disable/enable the rigid Motor6D joints when
	the humanoid enters valid ragdoll states
--]]



local buildConstraints = require(script:WaitForChild("buildConstraints"))
local buildCollisionFilters = require(script:WaitForChild("buildCollisionFilters"))
--[[
	Initialises the controller, getting the client platform, and then requiring the correct set of view scripts
]]


function UIController.init()
	local platform = getClientPlatform()
	local platformViews = ReplicatedStorage.Source.UIViews[platform]

	-- Initialise these here, as we need to get the platform of the user.
	views = {
		mainMenu = require(platformViews.MainMenu),
		warmup = require(platformViews.Warmup),
		game = require(platformViews.Game),
		dead = require(platformViews.Dead),
		spectating = require(platformViews.Spectating),
		finished = require(platformViews.Finished),
		postGame = require(platformViews.PostGame)
	}

	UIController.extractStarterGui()

	Logger.debug("UIController loaded")
end
-- Get sound id


local get_material = function()
	
	local soundTable = footstepModule:GetTableFromMaterial(humanoid.FloorMaterial)
	local randomSound = footstepModule:GetRandomSound(soundTable)
	
	return randomSound
end

RunService.RenderStepped:Connect(function(delta)
	if timer > 0 then
		timer -= delta
	end
	if timer < 0 and check_movement() then
		footstepsSound.SoundId = get_material()
		footstepsSound.Parent = nil
		footstepsSound.Parent = rootPart
		timer = 0.5 / ((humanoid.WalkSpeed / 16) * 1.25)
	end
end)
-- Separate the functions to format props, children, and element,
-- so a plugin could override a particular function, if needed.
-- Too bad, so sad: the traditional (but unnecessary) space
-- in a self-closing tagColor requires a second test of printedProps.


function printElement(
	type_: string,
	printedProps: string,
	printedChildren: string,
	config: Config,
	indentation: string
): string
	-- ROBLOX deviation START: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	local tagColor = colors.tag
	-- ROBLOX deviation END
	return tagColor.open
		.. "<"
		.. type_
		.. (if Boolean.toJSBoolean(printedProps)
			then tagColor.close .. printedProps .. config.spacingOuter .. indentation .. tagColor.open
			else printedProps)
		.. (if Boolean.toJSBoolean(printedChildren)
			then
				">"
				.. tagColor.close
				.. printedChildren
				.. config.spacingOuter
				.. indentation
				.. tagColor.open
				.. "</"
				.. type_
			else (if Boolean.toJSBoolean(printedProps) and not Boolean.toJSBoolean(config.min) then "" else " ") .. "/")
		.. ">"
		.. tagColor.close
end
exports.printElement = printElement

function printElementAsLeaf(type_: string, config: Config): string
	-- ROBLOX deviation START: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	local tagColor = colors.tag
	-- ROBLOX deviation END
	return tagColor.open .. "<" .. type_ .. tagColor.close .. " …" .. tagColor.open .. " />" .. tagColor.close
end
exports.printElementAsLeaf = printElementAsLeaf

return exports