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

What is wrong with my animation script?

Asked by
Seraine 103
9 years ago

If someone says "/e sprinkler" or "/e cabbage", the script checks if they're in a certain group, if they are then they would perform the follow animations. If they aren't then nothing happens.

YourGroupId = "846314"
function onPlayerEntered(newPlayer)

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        if msg == '/e sprinkler' and newPlayer:IsInGroup(YourGroupId) then
            player.animationID = 149359445
        if msg == '/e cabbage' and  newPlayer:IsInGroup(YourGroupId) then
            player.animationID = 168149515

Thanks

0
To me, it appears you forgot the 'end''s for the 'if' statements and functions, ya Silly Billy. :) TheeDeathCaster 2368 — 9y
0
Adding end doesn't seem to affect the script. Thanks for pointing out anyway! Seraine 103 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

You don't need onPlayerEntered, remove that. Also, when you have the event fire for PlayerAdded, you called the new player "player". On lines 6 and 8 you wrote "newPlayer" instead of "player". Just fix those things, and don't forget to write ends.

Ad

Answer this question