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

Torso isn't locked upon player entering game?

I'm doing this so that the player has to press a GUI button to be "unlocked" , but that's in a different script.

This script is in the Workspace, but it wont work for some reason in both Solo mode and multiplayer.

game.Players.PlayerAdded:connect(function(player) player:WaitForChild(player.Character) local torso = player.Character.Torso torso.Anchored = true end)

1 comment

0

PS: This is a regular script, not a local script, that's being used

1 answer

✓ Accepted answer

The player's character is not a child of the player, it is a property like any instance's parent. There is an event for that.

This script I wrote seems to work in solo.

function onCharLoaded(char)
	char.HumanoidRootPart.Anchored = true
end

function onPlayerAdded(player)
	player.CharacterAdded:connect(onCharLoaded)
end

game.Players.PlayerAdded:connect(onPlayerAdded)

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