Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why isn't my sword isn't dealing any damage?

Here's the script in my sword:

script.Parent.Parent.Equipped:Connect(function()
	script.Parent.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") then
			if hit.Parent.Name ~= script.Parent.Parent.Parent.Name then
				if script.Parent.Parent.CanDamage.Value == true then
					hit.Parent.Humanoid:TakeDamage(22)
				end
			end
		end
	end)
end)

No errors pop up or nothing :v

1 answer

First of all I recommend using a debounce within a script and not a value. And that’s basically all I can say because you didn’t really organize your script very well and it’s hard to know where everything is. Trying editing it and adding variables for most of the things. Also when you say if canDamage.value == true then u want to change canValue to false so it doesn’t damage the player over and over again. And the after a few seconds set it back to true. But yeah I would recommend a debounce within a script.

1 comment

0

I am not able to understand much by that script where the error is. as said by @alphexus try adding debounce and also can u send and image of explorer

This discussion is preserved as it was. New answers, comments, and votes are closed.