I want that lua will effect ONLY in specific map...

Status
Not open for further replies.

ManimiFire

Meow Motherfuckers.
Guys, how to do that lua will effect ONLY in specific map?

For example, only if sonic is at GREENFLOWER ACT 1, so this lua will activate:

Code:
addHook("ThinkFrame", do
	for player in players.iterate 
	     if player.mo and player.mo.skin == "sonic"
		 and (player.speed > 30*FRACUNIT)
		 player.pflags = PF_JUMPED
		 player.charflags = SF_RUNONWATER
		 P_SpawnGhostMobj(player.mo)
		 end
	end
end)

Can someone help me with this?
 
use gamemap == *maincfgmapnumhere*

You mean like this?:

Code:
addHook("ThinkFrame", do
	for player in players.iterate 
	     if player.mo and player.mo.skin == "sonic"
         and gamemap == MAP60 //Just an example
		 and (player.speed > 30*FRACUNIT)
		 player.pflags = PF_JUMPED
		 player.charflags = SF_RUNONWATER
		 P_SpawnGhostMobj(player.mo)
		 end
	end
end)
 
gamemap has to be a normal number (so it would be "and gamemap == 60")

EDIT: Also, do NOT directly set the pflags and skin flags like that!

Instead, use player.pflags = $1 | PF_JUMPED , that will add the jumped flag to the player's current flag instead of overwriting all of them, same goes for the skinflags.

To remove them later on, use player. the flag you need = $1 & ~FLAG

EDIT2: Also, if you want it for GFZ1, it's map 01, not 60.
 
Last edited:
Status
Not open for further replies.

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

Back
Top