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

Whats wrong with this?

I am trying to show a GUI when there is enough players here is the script:

-- Made by JoshLua COPYRIGHT 2014

local enoughplayers = game.StarterGui.wat.enoughplayers

local notenoughplayers = game.StarterGui.wat.notenoughplayers

p = game.Players:GetChildren()

playerpicked = p[math.random(1,#p)]

-- Scripting if enough players or not while true do if game.Players.NumPlayers >=4 then

wait(1)

enoughplayers.Visible=true

wait(5)

enoughplayers.Visible=false

end

end

if game.Players.NumPlayers >=3 then

wait(1)

notenoughplayers.Visible=true

wait(5)

notenoughplayers.Visible=false

end

1 comment

0

Errors?

1 answer

-- Made by JoshLua COPYRIGHT 2014

local enoughplayers = game.StarterGui.wat.enoughplayers

local notenoughplayers = game.StarterGui.wat.notenoughplayers

p = {}
for _, player in pairs(game.Players:GetPlayers()) do
	table.insert(p, player)
end
playerpicked = p[math.random(1, #p)]

wait(1)
enoughplayers.Visible = true

wait(5)
enoughplayers.Visible = false

if game.Players.NumPlayers >= 3 then
	wait(1)
	notenoughplayers.Visible = true
	wait(5)
	notenoughplayers.Visible = false
end

2 comments

0

It says this in the output : PlayerGui is not a valid member of DataModel 13:27:08.253 - Script 'ServerScriptService.MainScript', Line 2 13:27:08.254 - Stack End

0

Fixed.

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