I saw all of this, but i want to put all the code together in one file. Having groups where i block props for clients, such as TNT barrels, phx explosive barrels, along with the ignite tool and paint tool. But all the examples i have included are for either props, or groups, and i have no idea how to put them together. So i am asking for help in doing that, since i know nothing about lua.
This would work:
if not SERVER then return end
local groups = { "superadmin", "admin", "opperator" } --Add your groups here
local function block_build( ply )
for _,v in ipairs( groups ) do
if ply:IsUserGroup( v ) then
return
end
end
ULib.tsay( ply, "You are not allowed to build." )
return false
end
hook.Add( "PlayerSpawnProp", "block_prop", block_build )
hook.Add( "PlayerSpawnEffect", "block_effect", block_build )
hook.Add( "PlayerSpawnVehicle", "block_vehicle", block_build )
hook.Add( "PlayerSpawnSENT", "block_sent", block_build )
hook.Add( "CanTool", "block_tool", block_build )
I see the block_prop, effect, vehicle, tool, etc... but i dont know where to put the things i want to block. Do i replace the ply in block_build( ply )
with the location for props, and the tools?