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

Why can't players see my animation?

Asked by 3 years ago

I'm making a running animation script but other players can't see my animation other than me

Here's my localscript

local p = game.Players.LocalPlayer 
local char = p.Character 
if not p.Character then 
    repeat wait() until p.Character 
end

local human = char.Humanoid 
local anim = game.Workspace:WaitForChild("Animation")
local loadAnim = human:LoadAnimation(anim) 


local UIS = game:GetService("UserInputService")

local holdingShiftKey = false


UIS.InputBegan:Connect(function(inputObject) 

    if(inputObject.KeyCode==Enum.KeyCode.E)then
       holdingShiftKey = true


        if holdingShiftKey then
            loadAnim:Play()

           repeat wait(.5)
    char.Humanoid.WalkSpeed += 1
        until char.Humanoid.WalkSpeed == 25 or not holdingShiftKey 

        end

    end
end)


UIS.InputEnded:Connect(function(inputObject)

    if(inputObject.KeyCode==Enum.KeyCode.E)then
                holdingShiftKey = false
        char.Humanoid.WalkSpeed = 16
        loadAnim:Stop()
    end
end)

Can anyone help me with this?

1 answer

Log in to vote
0
Answered by 3 years ago

You are making the animation on the client, so only you will see it. The fix to this is to create the Animation object in Studio, and then play it via the LocalScript.

Hope this helped

0
But isn't that what I did in the script? TheNINJA152 85 — 3y
0
That's exactly what I'm saying... brokenVectors 525 — 3y
Ad

Answer this question