#Want it so that Cracked Lava Kills the player
28 messages · Page 1 of 1 (latest)
You can check if Humanoid.FloorMaterial is Enum.Material.CrackedLava and kill the player.
where would you put this script?
~~You can detect a change in a specific property like so:
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if Humanoid.FloorMaterial == Enum.Material.CrackedLava then
Humanoid.Health = 0
end
end)
```~~
Just remember that, if a player dies, their Humanoid is replaced, so connect the above event everytime the player dies.
Actually, there is a better way, or simpler.
--
-
Put a
Scriptinside ofgame.StarterPlayer.StarterCharacterScripts. This will put whatever scripts inside that folder into the character on respawn. -
Paste in this code:
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if humanoid.FloorMaterial == Enum.Material.CrackedLava then
humanoid.Health = 0
end
end)
yes
Send whatever errors you get, unless it is a plugin error, okay? Because lets us how what is wrong.
I have modified the code and hopefully it will work now. Just a little typo.
Okay, you should mention that as well, because it indicates errors.
Does it work now?
mb i forgot
Okay good, now mark the post as ✅ Solved by tagging.