Introducing Gupshup Superagent – Get Early Access
Book a Demo

Fe Kick Ban: Player Gui Script Patea A Cu

script.Parent.MouseButton1Click:Connect(function() local targetName = playerBox.Text local reason = reasonBox.Text

button.MouseButton1Click:Connect(function() local targetName = script.Parent.TargetNameBox.Text Remote:FireServer("Kick", targetName, "You were kicked by an admin.") end) fe kick ban player gui script patea a cu

A GUI in StarterGui containing a TextButton for "Kick" and a TextBox for the target's username. script

local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local AdminAction = Instance.new("RemoteEvent") AdminAction.Name = "AdminAction" AdminAction.Parent = ReplicatedStorage -- CRITICAL: Add the Roblox User IDs of authorized administrators here local WhitelistedAdmins = [12345678] = true, -- Replace with your actual User ID [87654321] = true -- Replace with a co-owner's User ID -- Function to find a player by partial name local function findPlayer(name) for _, player in ipairs(Players:GetPlayers()) do if string.lower(player.Name):sub(1, #name) == string.lower(name) then return player end end return nil end AdminAction.OnServerEvent:Connect(function(playerSending, actionType, targetName, reason) -- Security Check: Verify if the sender is an authorized admin if not WhitelistedAdmins[playerSending.UserId] then playerSending:Kick("Exploit Detected: Unauthorized Admin Action attempt.") return end -- Locate the target player local targetPlayer = findPlayer(targetName) if not targetPlayer then return end -- Establish a default reason if none provided if reason == "" then reason = "No reason specified by administration." end -- Execute the chosen action if actionType == "Kick" then targetPlayer:Kick("\n[ADMIN KICK]\nReason: " .. reason) print(playerSending.Name .. " kicked " .. targetPlayer.Name) elseif actionType == "Ban" then -- Using Roblox's modern built-in Ban API local banConfig = UserIds = targetPlayer.UserId, Duration = -1, -- Permanent ban (-1) DisplayReason = "\n[ADMIN BAN]\nReason: " .. reason, PrivateReason = "Banned via Admin GUI by " .. playerSending.Name local success, err = pcall(function() Players:BanAsync(banConfig) end) if success then print(playerSending.Name .. " permanently banned " .. targetPlayer.Name) else warn("Ban failed: " .. tostring(err)) end end end) Use code with caution. Crucial Security Warning Regarding RemoteEvents " kicked "

local replicatedStorage = game:GetService("ReplicatedStorage") local kickEvent = replicatedStorage:WaitForChild("KickPlayerRequest") local playerToKick = "UsernameHere" -- Get from a TextBox or PlayerList

end)

To actually kick or ban a player, your script needs to communicate with the game server. This usually involves sending a custom command or event to the server, which then handles the action.