• Ban Prop
    5 replies, posted
Who know how can i ban props , becouse I don't found on Gmod.org and I ask some people but nobody don't know !
[lua]if not SERVER then return end local ModelsToBan = {"model/to/ban/1.mdl", "model/to/ban/2.mdl", "model/to/ban/3.mdl"} hook.Add("OnEntityCreated", "BanTheseModelsThx", function(ent) if not ValidEntity(ent) or ent:GetClass() != "prop_physics" then return end local mdl = ent:GetModel() // Do it once instead of in each loop. for _,str in pairs(ModelsToBan) do if str == mdl then ent:Remove() return end end end)[/lua] Put that in a lua file in lua/autorun
[lua]local ModelsToBan = {"model/to/ban/1.mdl", "model/to/ban/2.mdl", "model/to/ban/3.mdl"}[/lua] And here I add more props ?? Like this [lua]"model/to/ban/4.mdl",[/lua]
Yes.
What about tools? Same technique?
[QUOTE=beasty;29239065]What about tools? Same technique?[/QUOTE] Yeah, but you'd need to use the CanTool hook.
Sorry, you need to Log In to post a reply to this thread.