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

Instance:GetChildren() should be working but it isn't?

This script should work but for some reason it doesn't, no errors are shown.

local plrs = game.Players:GetChildren() -- Needs lobby and at least 1 map till complete game (starting, last man standing and intermissions, and a winner)
local isIntermission = true
local i = "Intermission"
local g = "Game In Progress"
game.Players.PlayerAdded:Connect(function(plr)
if #plrs >= 1 then
	if isIntermission == true then
		wait(5)
		game.ReplicatedStorage.IntermissionEvent:FireAllClients(i)
	end
end
end)

Thanks!

1 answer

✓ Accepted answer
local players = game.Players
local isIntermission = true
local i = 'Intermission'
local g = 'Game In Progress'

players.PlayerAdded:Connect(function(player)
	for i,v in pairs(players:GetPlayers()) do
		if i >= 1 and isIntermission then
			print('Starting game')
			wait(5)
			isIntermission = false
			game.ReplicatedStorage.IntermissionEvent:FireAllClients()
			end
		end
	end
end)

NOTE: I'm in school so i can't really test it.

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