This error came from two scripts.
1st Script:
01 | wait( 1 ) |
02 | while game.ServerScriptService.Playing.AlivePlayers.Value > 0 do |
03 | local list = workspace.Map.CS:GetChildren() |
04 | m = list [ math.random(#list) ] |
05 | for i, v in pairs (game.Players:GetChildren()) do |
06 | v.PlayerGui.ScreenGui.ColorFrame.Frame.BackgroundColor 3 = m.Color |
07 | v.PlayerGui.ScreenGui.ColorFrame.ColorName.Text = m.BrickColor.Name |
08 | end |
09 | wait( 7 ) |
10 | for i, v in pairs (workspace.Map.CS:GetChildren()) do |
11 | if v.BrickColor.Name ~ = m.BrickColor.Name then |
12 | v.CanCollide = false |
13 | v.Transparency = 0.7 |
14 | end |
15 | end |
2nd Script:
01 | local text = game.ReplicatedStorage.Text |
02 |
03 | while true do |
04 | for i = 25 , 0 , - 1 do |
05 | text.Value = "Next Round in " ..i |
06 | wait( 1 ) |
07 | end |
08 | wait( 2 ) |
09 | text.Value = "Picking Gamemode..." |
10 | wait( 5 ) |
11 | local gamemode = math.random( 1 ) |
12 | if gamemode = = 1 then |
13 | game.Lighting.CS:Clone().Parent = workspace.Map |
14 | for i, v in pairs (workspace.Map.CS:GetChildren()) do |
15 | if v:IsA( "BasePart" ) then |
is not working in the real game
Error: ScreenGui is not a valid member of PlayerGui
all of these scripts are in a regular script in ServerScriptService.
I'm pretty sure you need to locate the object in the PlayerGui first.
Revised 1st Script lines 5-8
1 | for i, v in pairs (game.Players:GetChildren()) do |
2 | local gui = v.PlayerGui:FindFirstChild( "ScreenGui" ) |
3 | gui.ColorFrame.Visible = false |
4 | gui.TextLabel.Visible = true |
5 | game.ReplicatedStorage.Text.Value = "Nobody Survived!" |
6 | end |
Revised 2nd Script lines 29-32
1 | for i, v in pairs (game.Players:GetChildren()) do |
2 | local gui = v.PlayerGui:FindFirstChild( "ScreenGui" ) |
3 | gui.TextLabel.Visible = false |
4 | gui.ColorFrame.Visible = true |
5 | end |
If this doesn't solve your problem, please be more specific in the question you are asking like the error messages coming from it. If it's saying its nil or something.
Also if this doesn't work, make sure you name things in the StarterGui different things if there is more than one ScreenGui.
Think about it. Your browser shows you the images and text and this answer on your computer, not here. The server cannot do that, since your computer's display is on YOUR computer. So, handle UI work on your computer!