If you add a "Kill All" button to your game, ensure only you (the owner) can trigger the event, or hackers will use it to ruin your game for everyone. To help you get this working, could you tell me: Are you trying to add this to a game you are making ?
This report outlines the functionality, risks, and technical context of "Filtering Enabled" (FE) Kill GUI scripts within the Roblox platform. Executive Summary
-- Update targeted player every frame RunService.RenderStepped:Connect(function() -- Get target player local targetPlayer = Players:GetPlayerFromCharacter(workspace:FindFirstChild("Player"))
-- Place this in a LocalScript inside a GUI Button
The following script example demonstrates how to create a simple kill GUI that players can use to eliminate other players in a game. This script assumes you're familiar with basic Roblox scripting and GUI creation.
Only trusted server code can invoke TakeDamage , and the server validates team membership and caps the damage value.
-- Function to unhighlight targeted player local function unhighlightTargetPlayer(targetPlayer) if targetPlayer.Character then targetPlayer.Character:FindFirstChild("Highlight").Visible = false end end