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

Why does an animation work for others but not for me?

Asked by 3 years ago

So I've been trying to script a simple punch animation that plays when you left click.

I'm using a local script, a server script and a remote event to run it.

Here's the Server Script:

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player,animationID)
    local animation = Instance.new("Animation")
    animation.AnimationId = "http://www.roblox.come/Asset?ID="..animationID

    local loadedAnimation = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
    loadedAnimation:Play()
    print("Punched")
end)

And here's the Local Script:

game:GetService("UserInputService").InputBegan:Connect(function(input, engine_processed)
    if engine_processed then
        return
    end

    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        game.ReplicatedStorage.RemoteEvent:FireServer(7199296854)
        print("Yes")
    end
end)

My friend (The owner) joined and the punching animation worked for him and I could see it. I thought it was because he was the owner so I asked him to join on his other account and it still worked, but when I tried to punch it did not work.

0
1. animations should be played on client sides User#30567 0 — 3y
0
2. you should load an animation once, and play that over and over again instead of loading animations over and over again User#30567 0 — 3y
0
3. make sure the animation works for both r15 and r6 rigs. the animation in the code only supports r6. User#30567 0 — 3y
0
TTChaos, i got some stuff to say to you Gameplayer365247v2 1055 — 3y
View all comments (4 more)
1
1. animations can be played on the server just fine, second one i agree with completely 3. how do you know that animation only supports r6? Gameplayer365247v2 1055 — 3y
1
Does the console say anything? I have a crouch animation and when it doesn't load in the game doesn't show it playing. radiant_Light203 1166 — 3y
0
It does not show anything in the console. No errors. Intxrvision 2 — 3y
0
Im pretty sure i've figured it out. Theres something wrong with my account and its not playing animations. I tried on one of my other accounts and it worked perfectly fine. Intxrvision 2 — 3y

Answer this question