Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
4

What's wrong with this script?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

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

1
That didn't work, it looks better than what I had, though. User#4422 0 — 10y
0
Is name defined? Sublimus 992 — 10y
0
No @huner2 that may be the reason User#4422 0 — 10y
Ad
Log in to vote
0
Answered by 8 years ago
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.

Log in to vote
0
Answered by 8 years ago

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)

Answer this question