i've gotten inspired by the haunted staircase and the 2nd monster if you look at it behind you you die how can i do this? i dont see any tutorials on youtube
✓ ANSWER ACCEPTED
How do i make it so if you look at something youll die?
2 answers
✓ Accepted answer
deathPart = part -- Pass there your part, that part if you place cursor on it you will die.
local plr = game.Players.LocalPlayer -- define localplayer
local mouse = plr:GetMouse() -- get player's mouse
while wait() do -- make infinite checking loop
if mouse.Target == deathPart then -- if player cursor is placed on deathPart. Make them watch from first person or make invisible or barely visible part across whole area you want them to die when they look there.
plr.Character.Humanoid.Health = 0 -- kill player
end
end
https://developer.roblox.com/en-us/api-reference/function/Camera/WorldToScreenPoint
that one might help, i wont help everything but try to do it
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
aren't they talking about looking at it and not the mouse hovering over it?
YEAH
but i think this works too