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

Person cannot move when joined?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

This is in a local script and this does not keep the player still when they join.

function onEntered()
    h=script.Parent.Parent.Parent.Parent.Character
    ll=h:FindFirstChild("Left Leg")
    ra=h:FindFirstChild("Right Arm")
    rl=h:FindFirstChild("Right Leg")
    la=h:FindFirstChild("Left Arm")
    he=h.Head
    if (h.Torso.Anchored==false) then
    h.Torso.Anchored=true
    ll.Anchored=true
    he.Anchored=true
    ra.Anchored=true
    la.Anchored=true
    rl.Anchored=true
    h.Humanoid.WalkSpeed=0
    end
end

2
The problem might be the script fire to fast which basically means that the script runs before the Players character have loaded into the game. UserOnly20Characters 890 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago
game.Players.PlayerAdded:connect(function(Player)
    Player.CharacterAdded:connect(function(Char)
    for _,v in pairs (Char:GetChildren()) do
if v:IsA("Part") then
    v.Anchored = true
end
    end
    end)
end)
Ad
Log in to vote
2
Answered by
iSvenDerp 233 Moderation Voter
9 years ago

Hi...Not sure what ur asking for me to figure out but i think u want to make a players walkspeed different.

game.Players.PlayerAdded:connect(function(player) -- We r using the PlayerAdded Function
    player.CharacterAdded:connect(function(character) -- Were fixing to get into the juicy stuff.
        local hum = character:WaitForChild("Humanoid") -- We have called the humanoid and named it hum.

        hum.Walkspeed = 100 -- This makes the players walkspeed 100

    end)
end)




Hope This Helped Let me know if it did or didnt i can change it if it didnt:)

Answer this question