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

Why won't this shut down the server?

As you know, the only way to shut down the server is to kick all of the players. That's my problem. It's not kicking everyone! How the script works, is that when a character dies, it make a value true and then kick everyone. Is there something wrong with this script?

while true do 
	wait(1)
	if game.Workspace:FindFirstChild("ISDEAD").Value == true then
				for i,v in ipairs(game.Players:GetChildren()) do
					v:Kick("The Leader of the Noob Empire Is Dead. Rejoin.")
					game.Workspace:ClearAllChildren(workspace.Terrain)
					for i = 1, 100000000 do
						wait(0.5)
						v:Kick("The Leader of the Noob Empire Is Dead. Rejoin.")
						game.Workspace:ClearAllChildren(workspace.Terrain)
				end
			end
		end 
	end

1 comment

0

Are you using a regular script? If not, change it to regular.

1 answer

In on this line:

for i,v in ipairs(game.Players:GetChildren()) do

Change it to this:

for i,v in pairs(game.Players:GetChildren()) do

That should kick players, or at least fix one of your syntax error

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