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. :)
Roblox Kill Others Gui Script? i keep having trouble and know no lua :(
3 answers
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()
1 comment
Thank you! now i know nothing about lua, so i know im asking a lot but could you maybe make a script and show me so i can have an example? if not that's ok i get it but i don't know what most of that means, again thank you!
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
you should learn it, you will learn so much