how would I protect a console command from being used by a player, but still letting a gamemode use it?
[lua]function hello(ply, cmd, args)
if ply:IsValid() then return end
// code here
I think he wants the gamemode to run the command on the client though
yes, I want it to be used on the client.
In the /server/ file put
if args == nil then ply:ChatPrint(“Must contain arguements”) return end
if ply:IsAdmin() or not ValidEntity(ply) then – if we’re admin or console then continue
concommand.Add does the same as that but if you want to protect it use if ply:IsAdmin() then protected end in the server file, it’s not like they’re gonna magically know what console command you put in the server side anyway.