run on initial player spawn
-
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!
-
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 -
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.
-
are all the variables global?
-
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.gscVariables 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 -
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.