I made a damage script but It won't damage the test dummy.
local debounce = true
local candamage = script.Parent:WaitForChild("Blade").Damage.CanDamage.Value
script.Parent.Activated:Connect(function()
if debounce == true then
debounce = false
local player = game.Players.LocalPlayer
candamage = true
local Anim = player.Character.Humanoid:LoadAnimation(script.Animation)
Anim:Play()
wait(2)
debounce = true
candamage = false
end
end)
There is no error message, I don't know why the dummy's health won't go down. Here's the script in the blade:
script.Parent.Touched:Connect(function(hit)
if script.CanDamage == true then
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(15)
end
end
end)
Is something wrong with my script?

3 comments
The problem is that you're changing the value in a LocalScript, so it only changes for the client, not the Server. So the server reads the value as false, but the client reads it as true.
To fix this, you'll have to use RemoteEvents to send arguments/messages to the server to tell them you want this action to be crossed.
oh