Character that instantly dies in water

Is it possible to make a character that instantly dies in water? I'm currently trying to do so and I've had no luck getting it to work.
 
Maybe you could ask OrdoMandalore, as they made a Bubsy mod in 2.1 that instantly died in water.
 
Check for player.mo.eflags&MFE_UNDERWATER and perform P_KillMobj(player.mo)

Ideally this would be done in a PlayerThink hook.
 
Check for player.mo.eflags&MFE_UNDERWATER and perform P_KillMobj(player.mo)

Ideally this would be done in a PlayerThink hook.

So would something like...

addHook("PlayerThink", function(player)
if MFE_UNDERWATER
P_KillMobj(player.mo)
end
end
end

this work?
 
Code:
addHook("PlayerThink", function(player)
	if player.mo and player.mo.eflags&MFE_UNDERWATER
		P_KillMobj(player.mo)
	end
end)
You'll check if player.mo exists first before you call player.mo.eflags (spectators don't have a player.mo).
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top