So i made a math question generator, but the problem is, it doesnt get the right answers and i think this is because its not doing the order of operations. Could someone help me, because i really dont nkow how to get it to do them, to get it to work? Thanks

[lua]

for I=1,10 do

Ran = math.random(3,8)

Num = math.random(1,50)

Str = tostring(Num)

for Iz=1,Ran do

R = math.random(1,4)

R2 = math.random(1,50)

if(Operators[R] == â€ś+â€ť) then

Num = Num + R2

Str = Strâ€¦"+"â€¦R2

end

if(Operators[R] == â€ś-â€ť) then

Num = Num - R2

Str = Strâ€¦"-"â€¦R2

end

if(Operators[R] == â€ś*") then
Num = Num * R2
Str = Strâ€¦"*â€ťâ€¦R2

end

if(Operators[R] == â€ś/â€ť) then

Num = Num / R2

Str = Strâ€¦"/"â€¦R2

end

end

Addquest(tostring(Str),tostring(math.Round(Num)),Ran*20)

end

[/lua]