Jump to content
  • 0

Player number in Fraggle/LegacyScript


DU0

Question

In multiplayer, how do I get the player number, so I can refer to it in code?

 

I'm trying to make a linedef that only teleports player 1 elsewhere when it's crossed. Ideally it'd only be activated by player 1, but that's optional right now.

 

I've tried a "print(player);" and "print(playerobj)" and "print(trigger);", but player and playerobj just gives me crazy numbers, which are the same to both players in multiplayer, and trigger just gives me the "doomplayer" string.

 

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0

OK, I sort of figured this out. You need to use "player(x)" to refer to the player, "x" being the player number. Player 1 is actually player 0.

 

Funny thing is that if I use player 1, player 2 gets kicked off of the server on the PSP as soon as it teleports. It works fine if I teleport player 2, however.

yay glitches

 

Anyway, my code looks like this:

script 1
{
	//teleports player 2, actually
	if(trigger == player(1))
	{
		teleport(player(1), 14); //14 = sector tag with the teleport thingie
	}
}

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...