Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's wrong with this script?

a = game.Players:FindFirstChild(Name) b = a.leaderstats.Money.Value script.Parent.MoneyBox.Text = (".. b..")

This script is located in a ScreenGui with a textbox named MoneyBox. This script's purpose is to display the money without the ugly looks of a leaderboard, which I have, but have hidden.

3 answers

You should be concatenating after a set of dual quotes:

script.Parent.MoneyBox.Text = ""..b --And there is no need for parenthesis

Here is a wiki article on concatenating: Concatenation

3 comments

1

That didn't work, it looks better than what I had, though.

0

Is name defined?

0

No @huner2 that may be the reason

b = a.leaderstats.Money --Don't define a variable with ".Value". I had this problem before.
script.Parent.MoneyBox.Text = "Money: "..b

I think that should work.

You may come across some problems while trying to concatenate a number with string.

a = game.Players:FindFirstChild(Name) 
b = a.leaderstats.Money.Value 
script.Parent.MoneyBox.Text = tostring(b)

This discussion is preserved as it was. New answers, comments, and votes are closed.