Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this Flag script not working?

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)

2 comments

0

That means the game can't find the GUI use a waitforchild parameter there

0

Thanks! It works now!

1 answer

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

1 comment

0

It is the name of the GUI

This discussion is preserved as it was. New answers, comments, and votes are closed.