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

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

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?

2 comments

0

What kind of Value is OwnerName?

0

StringValue

1 answer

✓ Accepted answer

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

1 comment

0

Neither of them worked, but thanks for the answer!

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