-- Must be called client-side

function PlayerConverter:SpeederToPlayer(playSound)
	-- LoadCharacter has to be fired server-side, so fire a RemoteEvent
	-- to get it there
	LoadCharacter:FireServer()
	PlayerConverter:SpeederToPlayerClient(playSound)
end -- PlayerConverter:SpeederToPlayer()

function PlayerConverter:SpeederToPlayerServer(player)
	player:LoadCharacter()
	
	LoadCharacter:FireClient(player)
end -- PlayerConverter:SpeederToPlayer()

function PlayerConverter:SpeederToPlayerClient(playSound)
	if playSound == nil then playSound = true end
	
	-- Play sounds
	if playSound and (UserInputService.MouseBehavior ~= Enum.MouseBehavior.Default) then
		ExitSound:Play()
	end
	
	-- Unlock and show mouse
	UserInputService.MouseBehavior = Enum.MouseBehavior.Default
	UserInputService.MouseIconEnabled = true
	
	-- Remove user from race ActivePlayer's list (if racing)
	RemoveActivePlayer:FireServer()
	
	-- Enable touch control GUIs on mobile devices
	local Players = game:GetService("Players")
	local player = Players.LocalPlayer
	local PlayerGui = player:FindFirstChild("PlayerGui")
	if IS_MOBILE then
		local TouchGui = PlayerGui:WaitForChild("TouchGui")
		
		TouchGui.Enabled = true
	end	
	
	local TopBar = PlayerGui:WaitForChild("TopBar")
	TopBar.Enabled = false	
end -- PlayerConverter:SpeederToPlayerClient()

function PlayerConverter:UnlockPlayerControls()
	UserInputService.MouseBehavior = Enum.MouseBehavior.Default
	UserInputService.MouseIconEnabled = true
	
	-- Remove user from race ActivePlayer's list (if racing)
	RemoveActivePlayer:FireServer()
	
	-- Enable touch control GUIs on mobile devices
	local Players = game:GetService("Players")
	local player = Players.LocalPlayer
	local PlayerGui = player:FindFirstChild("PlayerGui")
	if (IS_MOBILE) then
		local TouchGui = PlayerGui:WaitForChild("TouchGui")
		
		TouchGui.Enabled = true
	end	
	
	local TopBar = PlayerGui:WaitForChild("TopBar")
	TopBar.Enabled = false
end -- PlayerConverter:UnlockPlayerControls()