So I made this script to keep track of how much money you got by clicking, and it says the the values I am trying to accsess are "UserData" values. I don't know why it is saying this, or what a userdata value is. Could anyone help me?

[Edit]:Omg I'm so sorry I copy and pasted the wrong code! facepalms

ERROR:

22:03:08.155 - Workspace.MiningTycoon.Tycoons.Diamond. Essentials.Stats.StatBoard.GUI. Amount.Script:1: attempt to concatenate field 'MoneyMined' (a userdata value)

CODE: [Right Code]

script.Parent.Text = "Money Mined: 											$"..script.Parent.Parent.Parent.Parent.Parent.Parent.MoneyMined.Value

script.Parent.Parent.Parent.Parent.Parent.Parent.MoneyMined.Changed:connect(function	(money)
	script.Parent.Text = "MoneyMined: $"..money
end)

10 comments

0

print MoneyMined.

0

That's definitely not the same code you're showing us, because I see nothing about a 'MoneyMined' here.

0

yup p-p

0

Sorry but just a small tip, when concatenating things, put it in parenthesis for neatness if you want, like: script.Parent.Text = ("Money Mind: $"..script.Parent.Parent.Parent.Parent.Parent.Parent.MoneyMined.Value)

0

Doesn't matter ^

0

On line 1, what is MoneyMined? Is it a string value an int value a number value What? And where is the value located?

0

MoneyMined is an integer value located in game.Workspace.Tycoon.TycoonFolder.Diamond.MoneyMined

0

I think the value has to be a string value in order to... Use it as a string. Try, if you can, to change the integer value to a string value. If you can't there is a workaround.

0

Ok, ill try that.

0

Thanks! it worked!