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

IsInGroup help? [Script Included]

Asked by
Vividex 162
10 years ago

Its supposed to change your speed to 21 if your in a group, doesn't work, help?

function onPlayerEntered(newPlayer)
if game.Players[newPlayer.Parent.Name]:IsInGroup(950346) == true then
newPlayer.Character.Humanoid.WalkSpeed = 21
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)

Would this work?

0
What is "human" Tempestatem 884 — 10y
0
" == true" is not neccessary. "if" checks if the the statement between "if" and "then" is true. And yeah, what is "human"? gskw 1046 — 10y
0
Would it work now that I changed human to newPlayer? Vividex 162 — 10y
0
Try testing it Tempestatem 884 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

This is just my guess, but this should work!

function onPlayerEntered(newPlayer)
if newPlayer:IsInGroup(950346) then
newPlayer.Character.Humanoid.WalkSpeed = 21
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)

0
Works, thanks! Vividex 162 — 10y
Ad

Answer this question