Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Roblox Kill Others Gui Script? i keep having trouble and know no lua :(

Asked by 5 years ago

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. :)

0
you should learn it, you will learn so much 123nabilben123 499 — 5y

3 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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()

0
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! EllaTheFloofyFox 106 — 5y
Ad
Log in to vote
0
Answered by
RFL890 4
4 years ago
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)

Log in to vote
-1
Answered by 5 years ago
Edited 5 years ago
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)

Answer this question