I've been trying to do a sword deal damage with animation but i can only use it once for some reason. Here's the script
local script:
1 | local Tool = script.Parent |
2 |
3 | script.Parent.Activated:connect( function () |
4 | Tool.RemoteEvent:FireServer() |
5 | end ) |
script:
01 | local Tool = script.Parent; |
02 | local usable = true |
03 | local Part = Tool.Handle.HitPart |
04 |
05 | Tool.RemoteEvent.OnServerEvent:Connect( function (Player) |
06 | if usable = = true then |
07 | usable = false |
08 | local player = script.Parent.Parent |
09 | local hum = player.Humanoid |
10 |
11 | local a = player.Humanoid:LoadAnimation(Tool.Throw) |
12 | a:Play() |
13 | local ten = true |
14 |
15 | Part.Touched:Connect( function (hit) |
Okay so the problem is on line script (not local script) it says: local Tool = script.Parent; the reason it doesnt work is because you put a semi-colon after Parent at the end of the line.
the proper way is: local Tool = script.Parent;