i want to make a obby so i was making the lava jumps part but i dont know how to make the lava kill humanoids. like if a humanoid touches the block then the lava will break the humanoids joints. note:this is my first time asking so u might not understand my question.
COMMUNITY QUESTION
how do i make something kill humanoids?
1 answer
Hello there.
The easiest way of doing it would be the following.
Put the script inside the parts.
There are more ways, but this is the easiest one.
--Variables--
local Brick = script.Parent
--End--
--Code--
local function PlayerTouched(Part) --The function to be fired
local Parent = Part.Parent --Finding the Player
if game.Players:GetPlayerFromCharacter(Parent) then --Checking if the part is actually a player in the server.
Parent.Humanoid.Health = 0 -- Setting the health of the player to 0, which kills them.
end
end
Brick.Touched:connect(PlayerTouched) --This fires the function when a player touches the part
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
maybe you should explain it?? lol its right but explain it to the guy so he can benefit from it.
As he said, it was his first time asking, I wouldn't want to over confuse him with all the explaining, would've he asked for extra explanation, I would've of course explained it.
explanation is needed for a perfect answer. If you scared that he won't understand it, try to make it as simple as possible
Yeah well, truth to be told, I didn't even think about the explanation, it didn't cross my mind at all, so yeah.. I normally do include explanations though.
thanks Torren_Mr
i did it and it worked for me but i was reading the comments and they were talking about explanation i should have asked u about explanation that time but im gonna go serch it up rn
There, I added some explanations too, don't forget to accept my answer so other people can already know this has been answered :)