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

Help with crashing script?

Asked by
shayner32 478 Trusted Moderation Voter
9 years ago

I'm trying to make a script that crashes someone, to use in F9 [silently crash people with my console in my games]

This is what I have:

local person = "INSERTNAME"
local people = game.Players:GetChildren()

for i,v in pairs(people) do
    if v.Name == person then
        while true do
        Instance.new("HopperBin",v.Backpack)
        wait(0.5) 
        end
    else
    end
end

It doesn't work and it doesn't seem to throw any errors. Could use some help.

1 answer

Log in to vote
2
Answered by 9 years ago

Problem1

If you want to make someone leave the game, use the Kick method. It crashes their game for you. Also, did you know you can add a special message for example:

game:GetService("Players").Player:Kick("You have been kicked!")
--This will kick the player and say this little message: "You have been kicked!"

Some people use Destroy instead of kick. Both work. Kick is better since you get the red box and the text inside of it. It also prevents them from being able to read your chat and stuff.


Problem2

This isn't much of a problem, it's more of a tip... You used game.Players:GetChildren(), you could also use game.Players:GetPlayers(). This way, you can ONLY get player objects and you don't need to see if someone's classname is player or something.



Finished Product

local player = game:GetService("Players"):FindFirstChild("NameHere")
local message = "You have been kicked from the server."

if player then
    player:Kick(message)
end



Hope it helps!

Ad

Answer this question