Basically I have a billboard GUI and it will change the text to your intvalue, it was working fine a minute ago but now its saying the age is 0 when thats not true at all. I have no idea where its getting the 0 from either
Code:
local gui = game:GetService("ReplicatedStorage").GUIS.AgeB
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local clonedgui = gui:Clone()
clonedgui.TextLabel.Text = "Age: "..player.Stats.Age.Value
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
end)
end)
Could it be that the Age IntValue hasn’t been loaded in by the time the script tries to find the value, meaning that it just takes the default value (0) before it is changed to 14?
Couldn’t you just add the overhead GUI from the server whenever you load in the data rather than create and IntValue on the client? As in, put it in your data script. Example pseudocode:
local age = DataService:GetAge()
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
createGui(character, age)
end
end