Author Topic: if player conditional  (Read 934 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
if player conditional
« on: February 22, 2020, 01:48:34 PM »
Checks for the player that triggered the command prompt. If actually there is no player linked to the command prompt, it will return as false. You can detect -1 to check if it's null
Code: [Select]
if player = 1 //Checks if the player executor is 1
{
}
if player = 2 //Checks if the player executor is 2
{
}
if player = -1 //Checks when there is no player executor
{
}

This will work for example when detecting from a character which player is executing that thing. (If you have 2 players with the same character, and you want different code for each one.)
Also can be used to detect which player collected an item in the item's command prompt.
Sorry because my English is not very good because I'm Spanish ;) :P

War

  • "The top player is here!"
  • Level 20: Nobom
  • *
  • Posts: 1490
    • View Profile
    • My website
Re: if player conditional
« Reply #1 on: February 22, 2020, 03:32:00 PM »
Checks for the player that triggered the command prompt. If actually there is no player linked to the command prompt, it will return as false. You can detect -1 to check if it's null
Code: [Select]
if player = 1 //Checks if the player executor is 1
{
}
if player = 2 //Checks if the player executor is 2
{
}
if player = -1 //Checks when there is no player executor
{
}

This will work for example when detecting from a character which player is executing that thing. (If you have 2 players with the same character, and you want different code for each one.)
Also can be used to detect which player collected an item in the item's command prompt.
🙌
Hey, wassup wassup? My name is Warrior555MainsGanon (but just call me War) and I'm the main guy behind Megaman Zero Online and the upcoming Matt's Adventure! I don't speak often here but I'm a very friendly lad so if you wanna talk, don't hesitate!