Hello everyone. I’m trying to make a money display. The problem is that the TextLabel is not showing the text, even though it prints as it should. Here’s the script:
local money = game:GetService("Players").LocalPlayer:WaitForChild("leaderstats"):FindFirstChild("Money")
local text = script.Parent.Text
print(money.Value)
print(text)
money.Changed:Connect(function()
text = "$" .. money.Value
end)
Thanks for reading.
Edit: The script is working fine. When I print the variable text, I get $1, which is the value of the money. My problem is that it doesn’t show on the gui.
This is a pretty simple problem, try using this instead:
game.Players.LocalPlayer:WaitForChild("leaderstats").Money.Changed:Connect(function()
script.Parent.Text = "$"..game.Players.LocalPlayer.leaderstats.Money.Value
end
This has to be a local script inside the TextLabel. Also just do game.Players.Localplayer. I think the issue I
Has to do with where the script is. Or whether it’s a LocalScript.
Agreed if you are naming your TextLabel “Text” then you are going to have a tough time of getting the actual TextLavel as a child. If you want to keep it as “Text” do FindFirstChild(“”)