Skip to main content

attempt to perform arithmetic on a string value

❌ Error

attempt to perform arithmetic on a string value

📍 Context

Happens when you try to do math operations on a string, e.g., '100' + 50. Often occurs with player stats, money, or inventory counts read as strings.

✅ Solution

  • Convert strings to numbers using tonumber(): local value = tonumber(myString) + 50
  • Ensure database values or input are of the correct type.

ℹ️ Additional Information

  • Always validate user input before using in calculations.