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
Try doing this, put this code in a LocalScript
instead, and use this revised code. Your problem is PlayerGui
is not apart of players, but is apart of the Player that is in Players
Tell me if it works or not
local A = "event1" local Lighting = game.Lighting local Choos = 0 local Players = game.Players.LocalPlayer 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