function CoinsToGUI()
local players = game.Players:GetChildren()
	
	for i = 1, #players do
		wait(0.01)
	
		local CurrencyGui = players[i].PlayerGui:WaitForChild("CurrencyGui")
		local Stats = players[i]:WaitForChild("Stats")
		local Coins = Stats:WaitForChild("Coins")
		local CoinText = CurrencyGui.CoinText.Text
	
		CoinText = " "..Coins.Value.." "
		
	end
end

while true do
	wait (0.01)
		CoinsToGUI()
end

Not sure why this script isn't working.... It's supposed to match the value called "Coins" that is in the player. There's no error in the output. When I manually change the value to 10 (or any number, let's call that x) the gui's text just stays as 0. Does someone know what's wrong with this?

2 comments

0

On line 10, remove .Text and on line 12, after CoinText, add .Text

0

Thank you! That worked! But one question, why did it work?