I have a game where lava rises, if it touches you you die. The only issue is that when you're sitting down the touched event doesn't work and the lava rises right over top of you. Has anyone else ever come across this issue?
✓ ANSWER ACCEPTED
Why doesn't the Touched event fire on a player when they are sitting?
1 answer
✓ Accepted answer
Hello, you can use magnitude instead, like this:
Script:
local players = game:GetService("Players")
while wait() do
for i, v in pairs(players:GetChildren()) do
local char = v:WaitForChild("Character")
local foot = char.FOOT -- Idk how it is called right now, you can use leg instance or foot instance on R15
local lava = lavaLocation -- past here your lava part location
if (lava.Position - foot.Position).magnitude < 1 then -- if lava is less then 1 foot away from middle of leg or foot part
char.Humanoid.Health = 0 -- kill player
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
