Tool script won't run function on activation?
So I am trying to make a script that swings a knife when you click. Because the knife will interact with other players on the server, I thought I'd make it a serverscript. So I wrote the script along with the variables I'll need for animating. Getting the humanoid works, but the script fails to print "yay" (which is a placeholder for Track:Play() ) Does anyone know why this is happening? What can I do to fix it?
02 | script.Parent.Equipped:Connect( function () |
03 | hum = script.Parent.Parent:WaitForChild( "Humanoid" ) |
07 | local anim = Instance.new( "Animation" ) |
08 | anim.Name = "KnifeAnim1" |
10 | local Track = hum:LoadAnimation(anim) |
11 | local PlayingAnimations = hum:GetPlayingAnimationTracks() |
13 | script.Parent.Activated:Connect( function () |