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

Whats wrong with this?

Asked by 9 years ago

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

0
Errors? Relatch 550 — 9y

1 answer

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
9 years ago
-- 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
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 antlerer 33 — 9y
0
Fixed. Relatch 550 — 9y
Ad

Answer this question