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

Can you not compare Values and Strings in an if statement?

Asked by 9 years ago
if plr.Name==script.Parent.Parent.Parent.OwnerName.Value and plr.leaderstats.Money.Value>=price then
            plr.leaderstats.Money.Value=plr.leaderstats.Money.Value-price

this returns the error that I'm comparing a Value to a String, which you can't do apparently. So what should I do to fix this?

0
What kind of Value is OwnerName? Discern 1007 — 9y
0
StringValue nightshade7382 20 — 9y

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

Make sure that plr.leaderstats.Moneyis an IntValue and OwnerName is a StringValue

Another problem could be, if the Value object is named "Value", you need to make sure to use Money.Value.Value or OwnerName.Value.Value

0
Neither of them worked, but thanks for the answer! nightshade7382 20 — 9y
Ad

Answer this question