would it have anything to do with nothing is defined for threading it, therefor is not defining the player to do the effect? things like
should be
then in the thread gumball()
Double Post Merge: January 04, 2017, 06:59:39 am also theres nothing defining the player here, you have it getting an array of all players then dropping it at that spot, which idek how that would work. change the powerup funcions to something like this
Title: Re: Functions not threading properly.
Post by: HyperFirez on January 04, 2017, 01:36:58 pm
When I put player thread in the gumball() function, it says that it is an uninitialized variable...
Title: Re: Functions not threading properly.
Post by: death_reaper0 on January 04, 2017, 07:27:44 pm
oh my bad, when a script is called by a player, self is whats used to thread other threads, so chnage all the players in gumball to self
When is player used?
Title: Re: Functions not threading properly.
Post by: death_reaper0 on January 05, 2017, 07:27:29 am
well theres lots of things that can define the player, for example:
if you have a trigger to be activated by a player you would normally have something like
this tells the script that whoever activates the trigger, will be defined as "player" for the rest of that function, or untill that line is reintroduced. it doesnt have to be called "player" either, you can have it as anything you want but id recommend something thats easy to understand, like player or user. if a player is used to call a function like
inside that function the player will be defined as "self" so if you want the player that called that thread to do something, have it as "self do_something()" instead of player.
theres a lot of things to learn for this, so i dont really have the time to go through them all, but from the look of your script you shouldnt need any other way just yet (you will probably need it for some of the gumball effects)
Title: Re: Functions not threading properly.
Post by: HyperFirez on January 05, 2017, 01:37:59 pm
Thanks again. Also thanks for the mini tutorial. :P