Why does the Gui not show up? To all the players in the game? When the disaster start. Can someone help me ? Only the gui part of the script doesn't work.
local A = "event1"
local Lighting = game.Lighting
local Choos = 0
local Players = game.Players:FindFirstChild("PlayerGui")
while true do
Choos = math.random(8)
wait(4)
if Choos == 2 then
a = script:findFirstChild("GuiA"):Clone()
a.Parent = Players.PlayerGui
wait (5)
a = Players.PlayerGui:findFirstChild("GuiA"):Destroy()
b = script:findFirstChild("GuiAA"):Clone()
b.Parent = Players.PlayerGui
game.Lighting:findFirstChild(A):clone().Parent = game.Workspace
Lighting.Brightness = 0.001
Lighting.OutdoorAmbient = Color3.new(255/255, 255/255, 255/255)
Lighting.ShadowColor = Color3.new(255/255, 255/255, 255/255)
Lighting.FogColor = Color3.new(255/255, 255/255, 255/255)
Lighting.FogEnd = 150
Lighting.FogStart = 0
wait (10) --Back normal
Lighting.Brightness = 1
Lighting.OutdoorAmbient = Color3.new(127/255, 127/255, 127/255)
Lighting.ShadowColor = Color3.new(178/255, 178/255, 183/255)
Lighting.FogColor = Color3.new(75/255, 75/255, 75/255)
Lighting.FogEnd = 3000
Lighting.FogStart = 0
b = Players.PlayerGui:findFirstChild("GuiAA"):Destroy()
game.Workspace:FindFirstChild(A):Destroy()
wait(2)
end
end

1 comment
PlayerGui isn't a Valid member of Players! I suggest using a In pairs loop to loop for all the players inside of Players and then Parent the Gui inside the player's PlayerGui.