I didn't know how to explain this one in the title. Anyway so I was messing around with return and I got an idea that involved math so I tried creating a script that printed out a sum of a math equation that the LocalPlayer says (Example: '1 + 1' -> '2') but I don't know how to make it detect the numbers of 1 to 100. Any help?
Edit: I was trying to use math.random but it doesn't seem to work because it picks 2 random numbers and not any value of 1 & 100 for what i'm trying to do.
function add(num1,num2)
return num1 + num2
end
n1 = math.random(1,100)
n2 = math.random(1,100)
game.Players.LocalPlayer.Chatted:connect(function(msg)
if msg:lower() == n1..' + '..n2 then
local a = add(n1,n2)
print(msg.." = "..a)
end
end)

6 comments
you want to create script which will find numbers and add them?
Yes, I want it to print the sum of the equation when the LocalPlayer chats '(Number) + (Number)'
Huh I did script. Ill post it in sec
Mk thank you.
Np
Also if You will want to add more functions like "/" or "*" then just look in commants of my answer ;)