this is actually amazing
Please help it’s been two days and I’ve had no help at all
I’m completely lost on what it is you’re trying to achieve in this post
Alright man, here’s some dangerous code which can allow you to do any calculator operation! Be careful when using this as if any client has access to its input, it could be a security flaw for your game!
local function calculate(operation)
return loadstring("return ".. operation)()
end
With this function, you can calculate any operation like this: calculate("1+1")
, or calculate("(2+3+4+5)-6-7")
. Try it out and let me know if this satisfies what you want!
Loadsting is not available. Are you trolling?
Make a calculator. Could do amazing things.
A TI-84 or basic arithmetic? Please be more specific about your goal
I see the problem, you need to account for if there are 3 numbers, hope this helps!
What kind of advanced sorcery is this
What if I want to use four numbers though…
Sorry, out of my expertise, good luck though!
With my function, you could run for any a,b,c,d in decimals, calculate("a+b+c+d")
!
I appreciate the attempt. May we both become the greatest coders one day.
Intriguing. So I can calculate slope by running the formula Y=MX+B? Very intriguing… indeed!
Unfortunately, since it is still loaded in as a roblox string, it needs to be formatted the same way you’d type it in a script. And according to my knowledge, if you have two numbers M and X each containing a different value, to calculate their product you can’t write MX
! You need to write instead M*X
.
Hope this helps!
Ah… the folly of man. I guess a calculator is impossible then.
You shouldn’t be devastated by this result! On the contrary, writing M*X
instead of MX
has its own very advantages. Imagine for some reason you already have a value assigned to MX
, M
and X
. If you want to calculate the product between M and X, you would indeed need to show that you don’t want the value contained in MX
! For that, you use an operator (as always), and in roblox, it’s the *
operator for multiplication.
Hope this helped!