Advertisement
3DCreator

Ban

Dec 22nd, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local module = {}
  2.  
  3. local datastore = game:GetService("DataStoreService")
  4. local bandata = datastore:GetDataStore("bans")
  5. local players = game:GetService("Players")
  6.  
  7. module.run = function(player, message, arguments)
  8.     local userid = players:GetUserIdFromNameAsync(arguments[2])
  9.     local reason = message:gsub(arguments[1].." "..arguments[2], "")
  10.    
  11.     bandata:SetAsync(userid, {true, reason})
  12.    
  13.     for _, v in pairs(players:GetPlayers()) do
  14.         if v.Name:lower() == arguments[2]:lower() then
  15.             v:Kick("You were banned for"..reason..".")
  16.         end
  17.     end
  18. end
  19.  
  20. return module
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement