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

Im trying to make this a sword combat script, but it's not working. Is everything properly wrote?

Asked by 4 years ago

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:

1local Tool = script.Parent
2 
3script.Parent.Activated:connect(function()
4    Tool.RemoteEvent:FireServer()
5end)

script:

01local Tool = script.Parent;
02local usable = true
03local Part = Tool.Handle.HitPart
04 
05Tool.RemoteEvent.OnServerEvent:Connect(function(Player)
06    if usable == true then
07    usable = false
08local player = script.Parent.Parent
09local hum = player.Humanoid
10 
11local a = player.Humanoid:LoadAnimation(Tool.Throw)
12a:Play()
13local ten = true
14 
15Part.Touched:Connect(function(hit)
View all 26 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

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;

0
It's not the problem, still not working properly Nanzito123 -1 — 4y
Ad

Answer this question