Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why can't players see my animation?

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

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

2 comments

0

But isn't that what I did in the script?

0

That's exactly what I'm saying...

This discussion is preserved as it was. New answers, comments, and votes are closed.