Problem with setting money from value to text

  1. What do you want to achieve? Keep it simple and clear!
    I wanna achive what if intvalue = 5 text is = 5 too

  2. What is the issue? Include screenshots / videos if possible!
    Issue is: When i join game script counts only when value = 1. (My standart text is 0). When value is 50, text still 1. No idea why. Here is a screenshot:

  3. I tryed look on youtube and DevHub, but didn’t find anything

Here is my script:


local MoneyLabel = script.Parent

local Value = workspace.Factory.PlayerMoney
while true do
	MoneyLabel.Text = Value.Value
end

Stop this. Don’t use while loops for this kind of stuff. When an event is available, use it.

local MoneyLabel = script.Parent
local Value = workspace.Factory.PlayerMoney

Value.Changed:Connect(function()
	MoneyLabel.Text = Value.Value
end)

But regarding the issue, it must be caused due to incorrect communication of the server and client.

Could you provide the scripts that are being used for this?

Okay sure, but first i will test that script.

Wait what. Alright then, have a nice day.

Okay nevermind, it works perfectly thanks

image
It works tho

Have a nice day too tho. Thank u again!

local MoneyLabel = script.Parent

local Value = workspace.Factory.PlayerMoney

Value.Changed:Connect(function()
		while wait() do
			MoneyLabel.Text = Value.Value
		end
	end
end)

You probably forgot to add the game.

local MoneyLabel = script.Parent

local Value = game.workspace.Factory.PlayerMoney
while true do
MoneyLabel.Text = Value.Value
 end

Bro, u can say just workspace, problem was not in that, i just forgot to write it solved

Mark as “solved” instead. That’s what that button is for.

Uhh where is it? Can’t find it lol

Solved button, near the :heart: button.

U mean solution? Already then tho

You haven’t marked. Please check again.

Check messages at top ayooo, i marked it

Unfortunately it doesn’t show up for me.