Simultaneous Hits Problem

Then add the debounce into the rock

I did that but like I said its not working because it registers it as one click because of just how fast the event fires for both

local Rock = script.Parent 
local Torso = player.Character.Torso
local Debounce = Rock.Debounce

Bindable.Event:Connect(function()
	if (Torso.Position - Rock.Position) < 7 and Debounce.Value==false then
        Debounce.Value=true
		Rock.Health - 2
        wait(1)
        Debounce.Value=false
	end
end)

and then in the rock add a bool value called Debounce
And is this a server side or a local script?

its a server sided script!!!

Ok then do the script I sent you with the Debounce in the rock not in the script

robloxapp-20210107-2125136.wmv (427.3 KB)
is this the result you are looking for?

you can make a table and then skip the player if they are in the table and add the player if they are not in the table then damage them, here the thread: [How do I make touch events debounce for every player? - #4 by MayorGnarwhal]

You can make another kind of debounce by passing the tick into an argument and then wait until the oldtick and currenttick reach like 1sec differance or smthing this way you could sync the debounce (If your real problem is that its firing too quickly I didn’t really bother to read everything tbh.

maybe for each group of rocks, make a table, you can only hit the rock if its in the first index, after being destroyed, remove it from the table.

first create a script inside your rock and paste this:

local health = 10
local example = true
local biting = true
local respawn = math.random(10,20)

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“IsAPick”) and biting == true then
local is = hit.Parent:FindFirstChild(“Type”)
if health > 0 then
if is.Value == “Pick” then
health = health - 5
end
elseif health <= 0 and example == true then
example = false

		script.Parent.Transparency = 1
		script.Parent.CanCollide = false

	end

end

end)

your tool should contain the following ;
SonGoku6325's Place Number_ 310 - Roblox Studio 07_01_2021 09_39_15 p. m. (2)
It is important that you add this value to your tool
SonGoku6325's Place Number_ 310 - Roblox Studio 07_01_2021 09_39_15 p. m. (3)

I hope it helps :slight_smile:

you can also use tables for debounces and they dont require any string values

@lilzy7 Tried that it didnt work
@SonGoku6325 Tried that it didnt work and complicated things
@xristos10 you didnt explain it well, didnt work either

Thanks guys for the help but nothing is working

What seems to be the problem here?

it does what can you show me what you tried

Alright so basically I just decided to make the player have to be really close to the rock

1 Like

show script the script to me s

no i fixed it already by just adjusting the magnitude

If that is the simple thought and it was the solution, it’s still not completely fixed for the future stuffs may break it due to some backlash, you should probably optimize the code.

theres no need to optimize the code; it just needed a simple mangitude change; I dont see any future underlying problems; good day to you :cowboy_hat_face: