Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. run on initial player spawn

run on initial player spawn

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
6 Posts 2 Posters 158 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Decundefined Offline
    Decundefined Offline
    Dec Contributor
    wrote on last edited by
    #1

    is there something like 'waittill( 'player_initial_spawn' )', I want a script to load for every user on their initial spawn.

    i made a script to give players rewards based on their rank but it runs the script soon as the black screen wait has passed and i dont know if theres another wait that could do this and have tried to find it with no luck if there is and u know it please let me know, Thankyou!

    1 Reply Last reply
    0
    • Resxtundefined Offline
      Resxtundefined Offline
      Resxt Plutonium Staff
      wrote on last edited by
      #2

      Not sure exactly what you're trying to do but if I understood correctly you could simply check for a variable on the player entity when a player spawns.
      if variable is not defined or false then do first spawn stuff and change the variable to true. This way it'll only work on the player's first spawn

      Decundefined 1 Reply Last reply
      1
      • Decundefined Offline
        Decundefined Offline
        Dec Contributor
        replied to Resxt on last edited by
        #3

        Resxt so me threading a bunch of scripts wont cause much of a problem?, Still learning as i go.

        so create a variable for each user default 0.
        after blackscreenspawn waittill do scripts and change user variable to 1.

        i didnt know it worked like that tbh.

        1 Reply Last reply
        0
        • Decundefined Offline
          Decundefined Offline
          Dec Contributor
          wrote on last edited by
          #4

          are all the variables global?

          1 Reply Last reply
          0
          • Resxtundefined Offline
            Resxtundefined Offline
            Resxt Plutonium Staff
            wrote on last edited by
            #5

            I don't get what you're saying. It's as simple as something like this
            https://github.com/Resxt/Plutonium-IW5-Scripts/blob/main/small_scripts/show_text_on_first_spawn.gsc

            Variables are declared in their scope like in Java for example
            The only ""exceptions"" are entities such as players since you can change/add properties on them and thus recover them somewhere else.
            You can also directly pass variables on level to have an equivalent of a global variable

            1 Reply Last reply
            0
            • Decundefined Offline
              Decundefined Offline
              Dec Contributor
              wrote on last edited by
              #6

              i understand im not the best at explaining things haha.

              sorry ive just been having trouble understanding how it all renders like i read u could declare variables but it wasnt in there that u set them as level.[nameofvariable] = 0; or for the player would it be player.[variable] = 0;.

              ive been using whats in that script which is player.pers[nameofvariable] which works fine i just wanted to know if other scopes could be used globally because it would be easier for me to seperate the level stuff im doing to player stuff so ill use player and level thanks.

              1 Reply Last reply
              0

              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Donate