How do you perform arithmetic operations on Attributes?

I have been trying to use Attributes to use as Values here’s what I did:
image

Gas, MaxGas, gasPerSecond is an attribute of numberValue
when I try to print each one of them it returns a number
but when I try to perform operations like

gas - gasPerSecond

it returns:
image

I’m I just dumb, or I really can’t perform math operations on Attributes?

The last solution I did was converting it to:

tonumber(gas) - tonumber(gasPerSecond)

Output’s still the same error. Please help Im stuck on this small issue.

1 Like

Should gasPerSecond be put in caps when calling it? GasPerSecond

IM SO DUMB thank you i think i need sleep

Correct me if I am wrong but pretty sure you can’t perform arithmetic operations.
For now you can do: tool:SetAttribute("Gas", Value)

(Nvm your not setting just printing.)

You can! it worked I just did a typo