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

I need help doing this animation script, used a remote event firing it and it wouldn't work?

Asked by
Nuqz 0
5 years ago
Edited by SerpentineKing 5 years ago

so, i am creating a game, and i keep trying to do the animations correctly and i can not do it for some reason. here is the script for the remote event firing it

Local Script

uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(a,b)
    bb = true
    if b then return end
    if a.UserInputType == Enum.UserInputType.MouseButton1 and bb == true then
        ani = game.StarterPack.AnimationPunch1
        game.ReplicatedStorage.RemoteEvent1:FireServer(ani)
        print("Hi")
        wait(1)
        bb = false
        wait(0.1)
        bb = true
    end
end)

Server Script

game.ReplicatedStorage.RemoteEvent1.OnServerEvent:connect(function(player,animation)
    local newanim = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
    newanim:Play()
    wait(0.5)
    newanim:Stop()
end)

i did it and the animation wouldnt play or anything

[SerpentineKing]: Input Correct Code Format

Answer this question