I need a code that would create a prop that cannot be picked up or moved at a certain location in the map.
Just fill the coordinates with 0 and what would be the code?
[lua]local ent = ents.create(“my_entity”)
ent:SetModel(“my/cool/model.mdl”)
ent:SetPos(Vector(0,0,0))
ent:SetAngles(Angle(0,0,0))
ent:Spawn()
ent:GetPhysicsObject():EnableMotion(false)
[/lua]
That should work, wrote in the reply window and untested though.
[lua]local ent = ents.Create(“my_entity”)
ent:SetModel(“my/cool/model.mdl”)
ent:SetPos(Vector(0,0,0))
ent:SetAngles(Angle(0,0,0))
ent:Spawn()
ent:GetPhysicsObject():EnableMotion(false)
[/lua]
Fix’d.
(ents.Create)
This will error if the model is invalid.