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

Cloning gui from startgui?

Asked by
j1011 0
10 years ago

So i made an announcer gui which is now inside StarterGui, What i'm trying to achieve is when the player successfully captured the flag the gui will announce this : game.StarterGui.Announce.Frame.Txt.Text = "Fort Altipix 2.0, controlled by " ..name2.. ", is being captured by the " ..name.. "!" ------- ->>> But its not working..

See the rest of the script.

001bin = script.Parent.Base
002owner = script.Parent.CurrentOwner
003distance = script.Parent.CaptureDistance.Value
004steps = script.Parent.StepsToBottom
005maxsteps = steps.Value
006a = script.Parent.P4
007b = script.Parent.P3
008c = script.Parent.P2
009d = script.Parent.P1
010neutral = script.Parent.NeutralColor.Value
011 
012attackingteam = nil
013defendingteam = nil
014 
015script.Parent.FlagManager.Disabled = false
View all 114 lines...

1 answer

Log in to vote
4
Answered by
DataStore 530 Moderation Voter
10 years ago

The StarterGui is a container whose contents is cloned to the spawning player's PlayerGui. After the player is spawned, there is no link between the StarterGui's GUI and the GUI which is in the player's PlayerGui (meaning that changes made to the StarterGui won't show until the player has respawned).

In order for you to display a notification on everyone's screen you'll need to iterate through the Players service and make changes to everyone's GUI (on top of changing the StarterGui's GUI). An example of how to do this is below.

01function Annoucement(Text)
02    game.StarterGui.Announce.Frame.Txt.Text = Text
03    for _, Player in pairs(game.Players:GetPlayers()) do
04        if Player:FindFirstChild("PlayerGui") and Player.PlayerGui:FindFirstChild("Announce") then
05            Player.PlayerGui.Announce.Frame.Txt.Text = Text
06        end
07    end
08end
09 
10Announcement("Hello, this is an announcement")
0
so hard =/ j1011 0 — 10y
0
It really isn't - I've literally given you a function you could throw in. You'd just have to replace the text changing lines with Announcement(Text_Here)... DataStore 530 — 10y
Ad

Answer this question