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

Animation Only Running Client Side How to fix?

Asked by
wswswff 39
1 year ago

Hello everyone so I have this problem where an animation does not show up when you play but if i go to the client it does show up. Here is my code and i am using a normal script inside of an npc, the animation only runs once

--Variables--

local hum = script.Parent:WaitForChild("Humanoid")
local animation = script:WaitForChild('IdleAnimation')
local humanim = hum:LoadAnimation(animation)

--Playing Animation--
humanim:Play()
humanim.Looped = true

humanim.KeyframeReached:Connect(function(keyframename)
    if keyframename == "HandsOut" then
        local gras = script.Parent.Parent.Spawn_Grass
        local gra = gras:Clone()
        gra.Parent = workspace
        gra.Transparency = 0
        gra.Anchored = false
        gra.CanCollide = true
        local money = game.ReplicatedStorage.GetMoney:Clone()
        money.Parent = gra
    end
end)

please help,

Answer this question