this is my first post sorry if its wrong but, is there any way i can make a script so i can click a gui button and kill other players? like all other players or (preferrably) selected players like i type there name and it kills them. if you have read this to here thanks for reading, help is apreciated. :)
Yes there is a way!
First, make a gui button and use the MouseButton1Click
event to know when the button is clicked. Then, make a script with a for
loop that loops through all of the players in the server and use an if
statement to check if the player is equal to the player who clicked the button (in the loop). And if the player is not the player who clicked the button, then get their character and use :BreakJoints()
function killOthers() for _, v in pairs(game.Players:GetChildren()) do local name = game.Players.LocalPlayer.Name if not v.Character.Name == name then v.Character.Head:Destroy() end end end yourButtonLink:MouseButton1Down:Connect(killOthers)
This should work(i haven't tested yet)
script.Parent.MouseButton1Down:connect(function() for i,v in pairs(game.Players:GetChildren()) do if v ~= script.Parent.Parent.Parent then v.Character.Humanoid.Health = 0 end end end)