I have a server script with this code:
local candamage = true
script.Parent.Activated:Connect(function()
script.Parent.Blade.Touched:Connect(function(hit)
local Char = hit:FindFirstAncestorOfClass("Model")
if Char then
local Hum = Char:FindFirstChild("Humanoid")
if hum then
if candamage == true then
candamage = false
Hum:TakeDamage(15)
wait(0.6)
candamage = true
end
end
end
end)
end)
But it only kills the player on the client like its inside a local script

10 comments
it worked a little but then the same bug happend
Hm, weird i tested it out on a local server. Worked for client and server. How are you testing it?
have a friend join the place itself
and the output says "Touched is not a valid member of Tool"
Ok, so do this. Hav everything but the damage part. Try a Remote Event, that when fired by a local script, the server sciprt in SSS, find the player and damage them.
nvm fixed it
how'd you fix?
sorry i just set the touch as the blade and it was fixed
can you specify? Just want to edit the code correctly.
Sp.Blade.Touched:Connect(function(hit) i set the touch detector to that line