So I got this model were you can insert your animations when clicked and does damage, but when I'm not using the tool or not clicking it still does damage to the player, In the tool, there's no handle. There is a boolvalue inside the tool which is named "CanAttack", please fix this!
Server script
local tool = script.Parent
local hitsound = tool:WaitForChild("Hit")
local canattack = tool:WaitForChild("CanAttack")
local plr = tool.Parent.Parent
local char = plr.Character or plr.CharacterAdded:wait()
local larm = char:WaitForChild("Left Arm") -- this can be changed im only using this for the R6 body type
local rarm = char:WaitForChild("Right Arm") -- this can be changed im only using this for the R6 body type
larm.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if canattack.Value == false then
if hum then
canattack.Value = true
hitsound:Play()
hum:TakeDamage(10) -- u can change this value
wait(.5)
canattack.Value = false
end
end
end)
rarm.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if canattack.Value == false then
if hum then
canattack.Value = true
hitsound:Play()
hum:TakeDamage(10) -- u can change this value
wait(.5)
canattack.Value = false
end
end
end)

5 comments
Hmm.. still doesn't work, there were instructions on putting it somewhere. I put it inside the server script but still broken.
*were no instructions.
and um.. still doesn't work.
This should be a LocalScript inside the tool
You should also include the rarm