Advertisement
clark

No compressors on spawn planet

Feb 1st, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local function OnEntitySpawn( ent )
  2.     if ent:GetClass() == "generator_gas" then
  3.         if game.GetMap() == "sb_vacuum_rc1" then
  4.             for k, v in pairs(ents.GetAll()) do
  5.                 if IsValid(v) and v:GetClass() == "base_sb_planet2" and v:GetSize() == 4096 then
  6.                     if v:GetPos():Distance(ent:GetPos()) <= v:GetSize() then
  7.                         ent:Remove() -- Remove the gas compressor.
  8.                     end
  9.                 end
  10.             end
  11.         end
  12.     end
  13. end
  14. CAF.AddHook("OnEntitySpawn", OnEntitySpawn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement