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

Why won't the sword swing animation play in a regular Roblox game?

Asked by 5 years ago

Hi, so I'm trying to script a sword with animations, and it works perfectly fine in studio, even when doing the multiplayer test, but when I enter the actual Roblox client, it won't play the animations, the sword still detects me clicking on the server script (which deals damage), so I know thats working. The local script could't be doing anything for all I know. Heres the code:

In the serverScript:

01function OnClick()
02    if script.Parent.Attacking.Value == false then
03        script.Parent.Attacking.Value = true
04        wait(0.75)
05        script.Parent.Attacking.Value = false
06    end
07end
08function touch(hit)
09    if script.Parent.Hitting.Value == false then
10        if script.Parent.Attacking.Value == true then
11 
12            hit.Parent.EnemyHumanoid.Health = hit.Parent.EnemyHumanoid.Health - 10
13            script.Parent.Hitting.Value = true
14            wait(0.75)
15            script.Parent.Hitting.Value = false
View all 22 lines...

And in the localScript:

01print("scriptready")
02function Equip()
03 
04    Anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animation)
05    print("Anim Loaded")
06 
07 
08end
09function onClick()
10    print("Checking")
11    if script.Parent.Attacking.Value == false then
12        print("Click")
13        Anim:Play()
14        wait(0.75)
15        Anim:Stop()
View all 25 lines...

Any help wpuld be usefull, thanks.

0
would* be helpful pengalu200 65 — 5y
0
Try usinging pcalls to see what went wrong emervise 123 — 4y
0
Lol I figured it out sorry pengalu200 65 — 4y

Answer this question