-
What do you want to achieve? Keep it simple and clear!
Get rid of errors
-
What is the issue?
Attempt to perform arithmetic (sub) on boolean and number
-
What solutions have you tried so far?
nothing
local updateRemote = RemoteHandler.Event.new("BankUpdate") -- mean new remote event
updateRemote.OnEvent:Connect(function(bType, val)
if bType == 1 then
local dift = val - bankValues.Bank -- Problem here
bankValues.Bank = val
bankFrame:SetValue("$" .. ShortenNumber(bankValues.Bank), dift)
bankFrame:SetExactValue("$" .. bankValues.Bank)
else
local dift = val - bankValues.Cash -- also too problem here
bankValues.Cash = val
cashFrame:SetValue("$" .. ShortenNumber(bankValues.Cash), dift)
cashFrame:SetExactValue("$" .. bankValues.Cash)
end
end)
what is bankValues.Bank? And is val a NumberValue or a IntValue or what?
Could you please explain more? There is not enough information given in this topic.
bankValues.Bank or bankValues.Cash is NumberValue. when money is added then the value will add like + 1 or others number
1 Like
Okay. What is val though? Like what type of value is that?
val is how much value when added + 1 or other number
It’s nil, Bank and Cash are value from datastore.
and my coding are working but why it’s error
oh I was fixed it by use tonumber(val)
1 Like