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

What did I do wrong here?

Asked by 9 years ago
01local msg = script.Parent.Parent.StarterGui.Ticker.Ticker.TextLabel
02 
03while true do
04wait(6)
05msg.Text = "Disaster: Flood"
06wait(9)
07msg.Text = "You have 60 seconds to build"
08wait(9)
09wait(60)
10function Flood()
11    game.Workspace.Flood.Size = Vector3.new(518, 22, 521)
12game.Workspace.Flood.CFrame = CFrame.new(Vector3.new(-1,10,-2.5))
13end
14 
15Flood()
View all 28 lines...

It is supposed to display a message on a gui but it isn't working and it also isn't showing any output. Anyone has any idea what I did wrong here?

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

Changing something inside the StarterGui will not change it for all of the players. Instead, you can create a function to display a message for all of the players:

01function Display(msg)
02    for _,v in pairs(game.Players:GetPlayers())do
03        local x=v.PlayerGui:FindFirstChild("Ticker")
04        if x then
05            x=x:FindFirstChild("Ticker")
06            if x then
07                x=x:FindFirstChild("TextLabel")
08                if x then
09                    x.Text=msg
10                end
11            end
12        end
13    end
14end
15function Flood()
View all 34 lines...
0
How do I put that inside a script? BringMeTacos 20 — 9y
0
Is that like a "how to use a computer" question? I'm not sure what you mean there. 1waffle1 2908 — 9y
0
Like where should I add that part of the code inside the script. BringMeTacos 20 — 9y
0
edited 1waffle1 2908 — 9y
0
Thank you! BringMeTacos 20 — 9y
Ad

Answer this question