Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I stop the Humanoid from getting stuck in the SpawnLocation?

I have this code where when I choose a team it teleports to that team's spawn location, but when it teleports, the humanoid gets stuck in the spawn location.

local player = game.Players.LocalPlayer
script.Parent.Parent.Enabled = true
script.Parent.MouseButton1Click:Connect(function()
	player.Team = game.Teams.Citizen
	script.Parent.Parent.Enabled = false
	player.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.citizen.Position)
end)

How do I fix this problem?

1 answer

Try moving the player upwards, because if you set the player's position to the spawn points position, and if the spawn is on the ground, that means half the player's body too will be underground.

    player.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.citizen.Position + vector3.new(0, 10, 0))

This discussion is preserved as it was. New answers, comments, and votes are closed.