script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if hit and Humanoid then
Humanoid.Health = -Humanoid.Health
end
end)
do this shorter code and make the death block CanCollide false
I know its not a problem using free models but I game I made for a past Youtube channel a few people ridiculed me that it was 95% free models in hindsight that was good because now I make 99% of the things in my game instead of only using free models which in my opinion improves the quality of the game
I donât think that FindFirstChildWhichIsA("Humanoid") instead of FindFirstChild("Humanoid") could be better even if it works anyways but why you continue to say to set CanCollide false if it isnât really necessary? You can make a kill part with CanCollide true
Looking at similar issues related to âkill brick delayâ this came up:
Is the code you showed us in a âLocalScriptâ or a âScriptâ
Also, searching for your specific problem on Google or the DevForum search button would give you plenty of posts related to the problem at hand.
local debounce = false
script.Parent.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if hit and Humanoid and debounce == false then
debounce = true
Humanoid.Health = -Humanoid.Health
wait(0.5)
debounce = false
end
end)
make a CanCollide true part
then make an invisible CanCollide false part that goes taller then then Visible part
make the invisible part the death block