So i’ve been workin on this game and this is supposed to be an expanding killbrick, however when the player is standing completely still it doesn’t do any damage, just goes right trough them (Its can collide false)
As you can see its a very simple script and if the player touches it while jumping or walks into it works just fine, the only issue is if the player stands still
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Health = humanoid.Health-255
Here’s the code, any help would be greatly appreciated.
u should use raycast for this cuz touch event only detect when a player touch a part while moving
You may want to look into GetPartsInPart to detect the hitbox better. I’ve seen other posts in here as well where people got help dealing with exactly what you’re dealing with. Just use the forums Search using the word GetPartsInPart.
Use :GetTouchingParts and loop through them. If you find a humanoid in the looped part’s parent, then take damage.
You might want to use
Humanoid.Touched as it detects when the humanoid stands on the part.
i wouldnt recommend using touched events unless your making something simple like a kill brick. instead, loop through all of the parts touching the instance with :GetTouchingParts. this will return a table then you can just table.find the part/instance you are looking for. good luck!
They are making a kill brick lol
Good point though