create entity for world?

Is it possible to create a entity that is set as world so ent:IsWorld() returns true?

Nope.

[editline]04:33PM[/editline]

Not after the map is compiled.

IsWorld only returns if the entity is part of worldspawn, so no. I’m not even sure why you would want to use that.

Well you could always fuck around with the metatables or simply override the function,so it will return true then but I don’t see any sense in that ^^

Allot of scripts use IsWorld to see if the user can screw around with things or not. Nough said.

Ill just overwrite the function.

Them things are still compiled with the map, such things like buttons/doors/elevators etc etc. Why not just add a filter to the Entity you want to block and check if a player can mess with it through the physgun hook.

[lua]
local new_world = ents.Create(“worldspawn”)
new_world:SetModel(“maps/gm_construct.bsp”)
new_world:Spawn()
[/lua]

Wouldn’t it be epic if that worked.

We can always try. To the bunkers!

If meshes work in a few hundred years finally similar things are kinda possible

Technically speaking worldspawn is a mesh itself. All the entities and shit are just extra data.