Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local function GoodSpawn(ply, tr, tblE)
  2. -- Code made by Falco
  3. -- Tweaked by Stalker cuz Falco is a dummy sometimes
  4.  
  5. local ent = ents.Create(tblE.ent)
  6. if not ent:IsValid() then error("Entity '" .. tblE.ent .. "' does not exist or is not valid.") end
  7. ent.dt = ent.dt or {}
  8. ent.dt.owning_ent = ply
  9. if ent.Setowning_ent then ent:Setowning_ent(ply) end
  10. local pos = ply:GetEyeTrace().HitPos
  11. ent:SetPos(pos)
  12. -- These must be set before :Spawn()
  13. ent.SID = ply.SID
  14. ent.allowed = tblE.allowed
  15. ent.DarkRPItem = tblE
  16. ent:Spawn()
  17.  
  18. local phys = ent:GetPhysicsObject()
  19. if phys:IsValid() then phys:Wake() end
  20.  
  21. return ent
  22. end
  23.  
  24.  
  25. ----------------------------------------------------------------------------------------------------------------------------
  26.  
  27. DarkRP.createEntity("TANK TEST FIX", {
  28. ent = "sent_Challenger_2_p",
  29. model = "models/Killstr3aKs/WoT/British/Challenger_2_tracks_l.mdl","models/Killstr3aKs/WoT/British/Challenger_2_tracks_r.mdl",
  30. price = 0,
  31. max = 50,
  32. cmd = "TankTestFix",
  33. allowed = {TEAM_RAFPVT, TEAM_RAFSGT},
  34.  
  35. -- This part is the only new thing you have to care about (AND THIS BIT HE ADDED)
  36. spawn = function(ply, tr, tblEnt)
  37. return GoodSpawn(ply, tr, tblEnt)
  38. end
  39. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement