Always check player.UserId rather than player.Name since players can change their usernames, but UserIDs are permanent.
remote.OnServerEvent:Connect(function(admin, targetUserId, duration) -- Verify admin status here if admin and admin.UserId == 123456 then -- Replace with actual admin ID banStore:SetAsync(targetUserId, bannedBy = admin.Name, timestamp = os.time(), duration = duration or "permanent" ) local target = Players:GetPlayerByUserId(targetUserId) if target then target:Kick("Banned by admin.") end end end)
: Because of this boundary, a script running strictly on the client (a LocalScript) cannot ban or kick another player from the server.