Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Torso isn't locked upon player entering game?

Asked by 9 years ago

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)

0
PS: This is a regular script, not a local script, that's being used konichiwah1337 233 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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)
Ad

Answer this question