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

Why can't people see my animation?

I'm trying to make a running script but other players can't see my animation

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)


Does anyone have a fix for this?

1 answer

✓ Accepted answer

It's because the animation is a child of workspace

if you want it to replicate correctly using a LocalScript, the animation must be the child of the player's character

2 comments

0

But where do I put it for it to do this? Or do I do "Anim.Parent = char"

0

Nvm I got it to work

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