wifiboost

Blame Code

Aug 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.02 KB | None | 0 0
  1. function gf2_spawn_debug( ply, command, args)
  2.     if args[1]==nil or args[2]==nil or args[3]==nil or args[4]==nil or args[5]==nil or args[6]==nil or args[7]==nil or args[8]==nil then return end
  3.     local eye_trace = ply:GetEyeTrace().HitPos
  4.    
  5.     local mode, ent, ply, t, st, q, vars, sp = args[1], args[2], tonumber(args[3]), tonumber(args[4]), tonumber(args[5]), tonumber(args[6]), args[7], args[8]
  6.    
  7.     if table.Count(args)==0 then return end
  8.    
  9.    
  10.     timer.Simple(t, function()
  11.         for k, v in pairs(player.GetAll()) do
  12.             if v:EntIndex()==ply then
  13.                 if not(tonumber(q)) then return end
  14.                 for i=0, q do
  15.                     timer.Simple(st*i, function()
  16.                        
  17.                        
  18.                         local ent = ents.Create(ent)
  19.                        
  20.                         if sp == "ply" then ent:SetPos(v:GetPos()) else ent:SetPos(eye_trace) end
  21.                         ent:Spawn()
  22.                         ent:Activate()
  23.                         ent:SetVar("GBOWNER", v)
  24.                         ent:SetOwner(v)
  25.                        
  26.                         if mode=="spawn_function" then
  27.                
  28.                             ent:SpawnFunction(v, v:GetEyeTrace())
  29.  
  30.                             ent:Remove()
  31.                         end
  32.                        
  33.                    
  34.                         local var_table = string.Explode(",", vars)
  35.                        
  36.                        
  37.                        
  38.                         for index, variable in pairs(var_table) do
  39.                             local var_exploded = string.Explode("=", variable)
  40.                             local arg_processed = nil
  41.                            
  42.                             if var_exploded[2]=="true" then var_exploded[2]=true elseif var_exploded[2]=="false" then var_exploded[2]=false end -- bool check
  43.                            
  44.                             if var_exploded[2]!=true and var_exploded[2]!=false then
  45.                                 if string.StartWith(var_exploded[2], "ply_")==true then
  46.                                     local ply_targ = tonumber(string.Explode("_", var_exploded[2])[2])
  47.                                     if player.GetAll()[ply_targ]:IsValid()==false then return end
  48.                                    
  49.                                     var_exploded[2]=player.GetAll()[ply_targ]
  50.                
  51.                                 end
  52.                             end
  53.                            
  54.                             if ent:IsValid() then ent:SetVar(var_exploded[1],var_exploded[2]) end
  55.                            
  56.                            
  57.                        
  58.                         end
  59.        
  60.  
  61.                            
  62.                            
  63.                
  64.                        
  65.                        
  66.                        
  67.                        
  68.                        
  69.                     end)
  70.                 end
  71.             end
  72.         end
  73.     end)
  74.  
  75.    
  76.  
  77. end
  78. concommand.Add( "advspawn_", gf2_spawn_debug )
Add Comment
Please, Sign In to add comment