: Inside your ScreenGui button to detect clicks and send the target player's name to the server. Step-by-Step Setup 1. The Server Script (Security & Action)
: Located in ServerScriptService to handle the actual Player:Kick() method. *FE* KICK PLAYER GUI SCRIPT | Roblox Kick Gui F...
-- Place in ServerScriptService local ReplicatedStorage = game:GetService("ReplicatedStorage") local KickEvent = ReplicatedStorage:WaitForChild("KickPlayerEvent") local ADM_IDS = 12345678, 87654321 -- Add your UserID here KickEvent.OnServerEvent:Connect(function(player, targetName, reason) -- Security: Only allow admins to fire this local isAdmin = false for _, id in pairs(ADM_IDS) do if player.UserId == id then isAdmin = true break end end if not isAdmin then return end local target = game.Players:FindFirstChild(targetName) if target then target:Kick("Kicked by Admin. Reason: " .. (reason or "No reason provided")) end end) Use code with caution. Copied to clipboard Player:Kick | Documentation - Roblox Creator Hub : Inside your ScreenGui button to detect clicks