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

Why is this Flag script not working?

Asked by 9 years ago

So this script is supposed to make a billboard GUI in a part in the flag say what team owns the flag. However, it's not doing anything. Output did give me something, I'll post it after I post the script.

Can someone please help me? Here's the script:

repeat 
wait()
until script.Parent:findFirstChild("CurrentOwner")

while true do
    local player = script.Parent.Name
    if script.Parent.CurrentOwner.Value == BrickColor.new("Bright blue") then
        player.GUI.Who.Text = "China"
    end
    wait(0.1)
end

Output: Workspace.Captureable Flag.Detect:8: attempt to index field 'GUI' (a nil value)

0
That means the game can't find the GUI use a waitforchild parameter there Mystdar 352 — 9y
0
Thanks! It works now! CoolJohnnyboy 121 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Are you sure GUI is the name of the Gui? Names can be case-sensitive by the way, I think.

0
It is the name of the GUI CoolJohnnyboy 121 — 9y
Ad

Answer this question