How to create a prop

How do i create a prop with lua, like on run it will create a prop at 0,0,0.
Thanks

[lua]local prop = ents.Create(“prop_physics”)
prop:SetModel(“path/to/the/model/you/want.mdl”)
prop:SetPos(Vector(0,0,0))
prop:Spawn()[/lua]
:eng101:

I love you

Don’t forget to
[lua]prop:Activate()[/lua]
it if you want physics.

Thanks, and before you post about an error you’re getting I forgot a ) in my script, which I just added. :smile:

Ooooh and if you want it to run on map load you probably need to place it into an InitPostEntity hook, like this :

[lua]hook.Add(“InitPostEntity”,“EntitySpawn”,function()
local prop = ents.Create(“prop_physics”)
prop:SetModel(“path/to/the/model/you/want.mdl”)
prop:SetPos(Vector(0,0,0))
prop:Spawn()
prop:Activate() – Thanks Overv
end)[/lua]

It would go in a lua file in lua/autorun/

Actually, i was just creating a server portal, which i don’t really wan’t it to move at all but thanks for that helpful tip! :3

[editline]08:25PM[/editline]

On a side note, Overv, can you help me with 3d2d, i don’t really get the concept of it. Well, not as much the concept or how to use it.