Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1.  
  2. test = 0
  3.  
  4. function Timer() //Create the Function for a fucking timer
  5.  
  6. local Timer = math.random(15,30)
  7.     timer.Simple( timer, ChairFunc)
  8. end
  9.  
  10. function ChairFunc()
  11.  
  12.    
  13.  
  14.     local x = math.random(1,256) //Generates the X variable
  15.     local y = math.random(1,256) //Generates the Y variable
  16.     local z = -130 //math.random(1,256) Generates the Z variable but is subject to change based on map
  17.  
  18.         local chairposition = Vector( x, y, z ) //Should generate a vector based on the random variables
  19.        
  20.     Msg(chairposition)
  21.        
  22.     local ent = ents.Create ("prop_physics") //Create chairs which are immovable
  23.     ent:SetModel ("models/props_c17/FurnitureChair001a.mdl") //sets the chairs model
  24.     ent:SetPos (chairposition) //sets chair position from the Vectors
  25.     ent:Spawn() //Spawns the ent
  26.    
  27.     test = test + 1 //Adds 1 onto a variable for the repeat call
  28.    
  29.     end
  30.    
  31.     repeat //repeats the defined function, in this case ChairFunc
  32.    
  33.         ChairFunc()
  34.        
  35.     until test == 5 //Will repeat until the test variable equals 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement