• Replacing entities
    2 replies, posted
is there a way to replace every entity on a map with another entity using its exact position and angles? example: replacing every weapon_357 on a map with a custom swep.
[lua] for k,v in ipairs(ents.FindByClass("weapon_357")) do pos = v:GetPos() ang = v:GetAngles() v:Remove() local newent = ents.Create("yourent") newent:SetPos(pos) newent:SetAngles(ang) newent:Spawn() end [/lua]
thank you very much!
Sorry, you need to Log In to post a reply to this thread.