Advertisement
LoveGmod1

Installation Cmdr

Mar 28th, 2023 (edited)
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. --Setup Server
  2. local ServerScriptService = game:GetService("ServerScriptService")
  3. local Cmdr = require(ServerScriptService.Cmdr)
  4.  
  5. Cmdr:RegisterHooksIn(ServerScriptService.Server.Hooks)
  6. Cmdr:RegisterDefaultCommands()
  7.  
  8. --Setup Client
  9. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  10. local Cmdr = require(ReplicatedStorage:WaitForChild("CmdrClient"))
  11.  
  12. --Setup Permissions
  13. local admins = {
  14.     [0] = true,
  15. }
  16.  
  17. return function(registry)
  18.     registry:RegisterHook("BeforeRun", function(context)
  19.         if context.Group == "DefaultAdmin" and not admins[context.Executor.UserId] then
  20.             return "Vous n'avez pas la permission d'éxécuter cette commande."
  21.         end
  22.     end)
  23. end
  24.  
  25. --Commande pour avoir votre UserId rapidement
  26. print(game.Players:GetUserIdFromNameAsync("username"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement