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.
 

Micro

sonic heroes is a good game
Maybe you could ask OrdoMandalore, as they made a Bubsy mod in 2.1 that instantly died in water.
 

CobaltBW

Community Noise Maker
Sonic Team Junior
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?
 

CobaltBW

Community Noise Maker
Sonic Team Junior
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).
 
Top