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

Humanoid:GetState() not working for some reason?

Asked by 4 years ago

So I was making my own chat system that if the player typed /e dance the player would play an animation. I also made some events to check if the player was moving. I did try to search but it still doesn't work.

This is the script:

01game.ReplicatedStorage.ChatMessage.OnServerEvent:Connect(function(p, msg)
02    if msg ~= "/e dance" then
03        -- code
04    else
05        local char = p.Character
06        local hum = char.Humanoid
07        local anim = char.Animations.Dance
08        local track = hum:LoadAnimation(anim)
09        if hum:GetState() == Enum.HumanoidStateType.None then
10            track:Play()
11        end
12 
13        hum.Jumping:Connect(function(jump)
14            if jump then
15                track:Stop()
View all 62 lines...

Answer this question