Advertisement
Guest User

1

a guest
Feb 11th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. /*================================= CREDITS =================================
  2. HyperFirez - Making the Script.
  3. HarryBo21 - Teaching me how to make the script.
  4. mentailty - Teaching me how to make the script as well.
  5. ================================= CREDITS =================================*/
  6. #include maps\_utility;
  7. #include common_scripts\utility;
  8. #include maps\_zombiemode_utility;
  9. //================================= RANDOMIZE GOBBLEGUMS=================================
  10. init( )
  11. {
  12. level.gumball = [ ]; //this creates an array, which is a container, that holds multiple objects - which at this point is empty
  13. add_gobblegum("kill_joy"); //this is calling the function we define below, which will add a object to that array
  14. level thread print_name(level.gumball[ 0 ]);
  15. }
  16.  
  17. add_goobblegum(name, func)
  18. {
  19. struct = SpawnStruct();
  20.  
  21. if( !IsDefined (level.gumball ) )
  22. {
  23. level.gumball = [ ];
  24. }
  25.  
  26. struct.name = name;
  27.  
  28. if( Isdefined (func) )
  29. struct.func = func;
  30.  
  31. level.gumball[ level.gumball.size ] = struct;
  32. }
  33.  
  34. print_name( array_object )
  35. {
  36. while( 1 )
  37. {
  38. iPrintIn( array_object.name ); //this will print a self.name from whatever object you passes in the arguement - arguemnt is what you put between the () when calling it.
  39. wait 1;
  40. }
  41.  
  42. init_machine();
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement