Touched doesnt fire if standing

So I have a touching event to damage the player if touched them. Im using a debounce for 1 second. but if I stand still on top of the damaged part it doesn’t damage me. I’ve tried using the inner box and outer box as collision avatars. This is what is happening:

1 Like

I am not very good a coding, however, may I see inside your script that your using to damage the player? Just to give me a better view.

1 Like

its very big so ima just cut out the useless parts:

for _, Part in pairs(Scripted) do
	if Part:IsA("BasePart") then
		Part.Touched:Connect(
			function(hit)
				if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Transformed") then
					local Humanoid = hit.Parent:FindFirstChild("Humanoid")
					if hit.Parent:FindFirstChild("Transformed").Value == false and Humanoid.Health >= 20 then
						if not isDamaged then
							isDamaged = true
							if Debug == true then
								print("Damage")
							end
							hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
							task.wait(1)
							isDamaged = false
1 Like

I think touched only fires with movement so that’s probably why it only works when your player moves.

1 Like

Touched will not be continuously fired if the player continues to stand on the box. It will only fire for every time the player comes into contact with the part.

Consider using :GetTouchingParts() for your use case.

2 Likes

Not to sure. The coding seems right to me …

@ComplicatedParadigm answer might be correct

How would I use gettouching part?

https://developer.roblox.com/en-us/api-reference/function/BasePart/GetTouchingParts

3 Likes

What exactly are you trying to do?