I made this script for my Ban GUI
local ReplicatedSorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local GetDataStore = DataStoreService:GetDataStore("BanUser") local BanPlayer = ReplicatedSorage:WaitForChild("BanPlayer") local Settings = require(ReplicatedSorage:WaitForChild("Setting")) local DataStoreSuccess = {} local Banned = {} Players.PlayerAdded:Connect(function(Player) local Success,Res = pcall(function() return GetDataStore:GetAsync(Player.UserId) end) if not (Success) then DataStoreSuccess[Player.UserId] = false Player:Kick("DataStoreFailed") end if (Success and Res) then Banned[Player.UserId] = true Player:Kick("You are Banned") end end) Players.PlayerRemoving:Connect(function(Player) if (DataStoreSuccess[Player.UserId] == false) then DataStoreSuccess[Player.UserId] = nil Banned[Player.UserId] = nil end if(Banned[Player.UserId]) then return end end) BanPlayer.OnServerInvoke = function(Admin,Type,UserString) if not (Settings)[Admin.UserId] then return "You are not an admin!" end local UserId if (tonumber(UserString)) then UserId = tonumber(UserString) elseif (tostring(UserString)) then local Success,Res = pcall(function() return Players:GetUserIdFromNameAsync(UserString) end) if Res and Success then UserId = Res end end if not(UserId) then return "Player does not exist" end local Success,Res = pcall(function() GetDataStore:SetAsync(UserId,Type) end) if (Success) then return "Player Has been Banned" else return Res end end
And then I did this script to go inside the ScreenGUI
wait(1 + math.random()) local ReplicatedStorage = game:GetService("ReplicatedStorage") local ContextActionService = game:GetService("ContextActionService") local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local Admins = require(ReplicatedStorage.Setting) local BanPlayer = ReplicatedStorage.BanPlayer local Sp = script.Parent local Main = Sp.Frame local Ban = Main.Ban local Unban = Main.Unban local User = Main.User local Error = Main.Error function BanUser(Type) local Message = BanPlayer:InvokeServer(Type,User.Text) if (Message) then Error.Visible = true Error.Text = Message wait(3) Error.Visible = false end end Ban.MouseButton1Down:Connect(function() BanUser(true) end) Unban.MouseButton1Down:Connect(function() BanUser(false) end) function Visibility() if not (Admins[LocalPlayer.UserId]) then return end Main.Visible = not Main.Visible end LocalPlayer.Chatted:Connect(function(Message) if (string.lower(Message) == "/bpanel") then Visibility() end end) ContextActionService:BindAction("BanFrameVisiblity", function(InputName, InputStats, InputKeys) if (InputStats == Enum.UserInputState.Begin) then Visibility() end end,false,Enum.KeyCode.E,Enum.KeyCode.ButtonA)
The issue is that an error keeps coming up saying "DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 45059373" and I don't know how to fix this or even what the issue is. This happens when I try to ban someone.