My killbrick script doesn't work unless you stand on it for a moment- I'm new to scripting so any help would be appreciated.
Heres the script.
function onTouched(Obj) local h = Obj.Parent:FindFirstChild("Humanoid") if h then h.Health = 0 end end script.Parent.Touched:Connect(onTouched)
Is your game using R15? Try changing to R6 or change your killbrick CanCollide property to false. You can also create a hitbox and connect an event that detects if the hitbox is touched by a killbrick (or vice versa), then kills the player.
This is pretty much common, as I acknowledged character's collision on parts are quite aching to work with, especially on character models with precise collision checks.
Here is how I make kill bricks. The script should be located in the part, and be a normal script. (not local script)
script.Parent.Touched:Connect(function(hit) local Hum = hit.Parent:FindFirstChild("Humanoid") Hum.Health = 0 -- As said in the comments, print the part that is hit like this: print(hit.Name) -- If it doesn't work, something is broken. end)
There can be errors in the scripts, but if it works, it works. Also, the reason you have to wait a bit before you die is because the script has to first read the whole function, instead of instantly being fired whatever code is given. Thats the difference, if you understand what I mean.