I need a script that will disable world props except for doors the last script I put in my server broke all of the doors and I had to delete it, I need this because without it there is a ton of world props in the way of role playing.
This Is Fucking Obvious If Your Not A Skid
Function GM:Think()
For K,v In Pairs(Ents.GetAll()) do
V:Remove()
End
End
This will fix it.
[lua]
--Goes in lua/autorun/server/FileNameHere.lua
function DeleteNonDoors()
local doors = {
["func_door"] = true,
["func_lookdoor"] = true,
["func_door_rotating"] = true,
["prop_door_rotating"] = true
}
for _, ent in ipairs(ents.FindByClass("prop_physics")) do
-- If you meant every single prop just replace "prop_physics" with "prop_*".
if not(doors[ent:GetClass()]) then
ent:Remove()
end
end
end
hook.Add( "InitPostEntity", "DeleteNonDoors", DeleteNonDoors)
[/lua]
Thank you for posting something helpful and being nice unlike some people in this thread.
[QUOTE=Velocity;38051883]Thank you for posting something helpful and being nice unlike some people in this thread.[/QUOTE]
No problem :v:
If you were wondering:
[lua]
--It's case sensitive
function GM:Think()--Think hook runs every frame.
for k,v in pairs(ents.GetAll()) do --find all the entities including players
v:Remove() -- remove everything
end
end--results in players not being able to join
[/lua]
He should be perma-banned for giving false information.
Sorry, you need to Log In to post a reply to this thread.