I was having a lot of trouble with this one piece of code that is supposed to fetch the price of items from similarly formatted text labels. While it works now, is there a way to simplify the code? Thanks.
The text being referenced is formatted like this: ItemName: $50
local price = string.sub(script.Parent.Parent.ItemName.Text,
string.sub(string.find(script.Parent.Parent.ItemName.Text, "%$"), 1, 2))
local price = tonumber(string.sub(price, 2))

1 comment
It looks very simple already.