I'm not sure what to say, really. The code is supposed to just change around some text on a billboard GUI whenever a value its connected to changes, but it doesn't seem to want to, and it's giving me a really weird error message that I can't make heads or tails of.
It's only a 40-something line code, and I really don't know why I'm getting the error message, so you'll have to forgive me for posting the entire thing...
PlaceName = script.Parent.Parent.Parent.Name --Find the name of the place,
NamDis = script.Parent.NameDisplay --and the display for the name.
StatDis = script.Parent.StatDisplay --Then find the display for the place's status,
StatusValue = game.Workspace.Statuses:FindFirstChild(PlaceName) --and the value for its status!
cols = game.Workspace.ColourCodes
NamDis.Text = PlaceName --First of all, we need to make sure that the GUI displays the right name!
function ChangeStat() --Neat little function to change the display, based on the base's status value.
if StatusValue.Value == 0 then
StatDis.Text = "CLEAR"
StatDis.TextColor3 = cols.clear.Value
end
if StatusValue.Value == 1 then
StatDis.Text = "RAID"
StatDis.TextColor3 = cols.raid.Value
end
if StatusValue.Value == 2 then
StatDis.Text = "OCCUPIED"
StatDis.TextColor3 = cols.occupied.Value
end
end
--Now for something really ugly... We want this function to run at the beginning of the game, and I'm awful. So, copypaste.
if StatusValue.Value == 0 then
StatDis.Text = "CLEAR"
StatDis.TextColor3 = cols.clear.Value
end
if StatusValue.Value == 1 then
StatDis.Text = "RAID"
StatDis.TextColor3 = cols.raid.Value
end
if StatusValue.Value == 2 then
StatDis.Text = "OCCUPIED"
StatDis.TextColor3 = cols.occupied.Value
end
StatusValue.Value.Changed:connect(ChangeStat)
And here's my output:
13:22:15.879 - Workspace.Zum City.BillboardGui.Frame.Script:45: attempt to index field 'Value' (a number value) 13:22:15.879 - Stack Begin 13:22:15.879 - Script 'Workspace.Zum City.BillboardGui.Frame.Script', Line 45 13:22:15.880 - Stack End
