Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SERVERSCRIPTSERVICE SCRIPT BY BLUEBLOX
- local banDS = game:GetService("DataStoreService"):GetDataStore("Bans")
- local mods = {613274783}
- game:GetService("Players").PlayerAdded:Connect(function(plr)
- local key = "-Banned" .. plr.UserId
- local success, val = pcall(function()
- return banDS:GetAsync(key)
- end)
- if(success) then
- if(val) then
- if(val[2] == true) then
- plr:Kick("\n You are permenetly banned. \n Reason: \n" .. val[1])
- end
- end
- else
- print("error" .. plr.UserId .. " " .. plr.Name)
- warn(val)
- end
- end)
- game:GetService("ReplicatedStorage").BanRequest.OnServerEvent:Connect(function(mod, plr, reason)
- if(table.find(mods, mod.UserId)) then
- local key = "-Banned" .. plr.UserId
- local success, err = pcall(function()
- banDS:SetAsync(key, {reason, true})
- end)
- plr:Kick("\n You are permenently banned. \n Reason: \n" .. reason)
- end
- end)
- game:GetService("ReplicatedStorage").UnbanRequest.OnServerEvent:Connect(function(mod, plr, reason)
- if(table.find(mods, mod.UserId)) then
- local key = "-Banned" .. plr.UserId
- local success, err =pcall(function()
- banDS:SetAsync(key, {reason, false})
- end)
- end
- end)
- game:GetService("ReplicatedStorage").KickRequest.OnServerEvent:Connect(function(mod, plr, reason)
- if(table.find(mods, mod.UserId)) then
- plr:Kick("/n You are kicked from this server. /n Reason: /n " .. reason)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement