Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Kick everyone from a server at once?

I've tried a few things that were kind of embarrassing, I'm using FE and it's a credit system. There's a script inside the workspace called Credit, simply printing made by me.

Inside one of the bigger scripts, I secretly added a little line of code that says

if game.Workspace:FindFirstChild("Credit") == nil then

After then, I tried a few methods that didn't seem to work.

if game.Workspace:FindFirstChild("Credit") == nil then
local player = game.Players:GetPlayers()
for i = 1, #player do
player:Kick()
end
end

..and a few other embarrassing ones.

Anyone who can help me out would, I would appreciate it.

1 answer

###You’re trying to kick a table, which will throw a syntax error.

for i = 1, #player do
    player[i]:Kick()
end

###Also, please indent your code, as it helps others to read it better. Unindented, messy code is illegible.

This discussion is preserved as it was. New answers, comments, and votes are closed.