How to make and print the Needed Money to get Item

Let’s say I have 10 Money, I need 25 for The object i need, how would i print the middle/center number how of many Money i need?, sorry for bad english

So your trying to print how much money you need until you are able to afford the price of the object?

Yes, i would need 15 More Money to afford the object

for example you have 10 cash
print("you need "..requiredMoney.Value - currentMoney.Value.."cash more to buy this item!!!!!")
since requiredMoney.Value is 25 and currentMoney.Value is 10, so you’ll need 25 - 10 = 15 more cash to get it.

1 Like

Subtract the object’s price with your current money

local CurrentMoney = 10
local ObjectPrice = 25


if ObjectPrice > CurrentMoney then
   local MoneyNeeded = ObjectPrice - CurrentMoney
   print(MoneyNeeded.. " more money to buy the object")
end
1 Like

I thought it was adding 10 + 15 But its fine!, thanks for helping me!!