Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("CoreGui"):FindFirstChild("Mat") then
- game:GetService("CoreGui"):FindFirstChild("Mat"):Destroy()
- end
- local function create()
- gui = Instance.new("ScreenGui",game:GetService("CoreGui"))
- gui.Name = "Mat"
- t = Instance.new("TextLabel",gui)
- t.Position = UDim2.new(0.886, 0,0.81, 0)
- t.Size = UDim2.new(0.057, 0,0.112, 0)
- t.TextScaled = true
- t.TextColor3 = Color3.new(1, 1, 1)
- t.BackgroundTransparency = 1
- local ui = Instance.new("UIAspectRatioConstraint",t)
- end
- create()
- while wait(.3) do
- if not game:GetService("CoreGui"):FindFirstChild("Mat") and not game:GetService("CoreGui"):FindFirstChild("Mat"):FindFirstChild("TextLabel") then
- create()
- end
- local expression = workspace.Map.Functional.Screen.SurfaceGui.MainFrame.MainGameContainer.MainTxtContainer.QuestionText.Text
- expression = string.gsub(expression, "%s+", "")
- expression = string.gsub(expression, "%s+", "=")
- expression = string.gsub(expression, "x", "*")
- local function performOperation(operand1, operand2, operator)
- operand1 = tonumber(operand1)
- operand2 = tonumber(operand2)
- if operator == "+" then
- return operand1 + operand2
- elseif operator == "-" then
- return operand1 - operand2
- elseif operator == "*" then
- return operand1 * operand2
- elseif operator == "/" then
- if operand2 == 0 then
- return 0
- end
- return operand1 / operand2
- else
- return nil
- end
- end
- local operand1, operator, operand2 = string.match(expression, "([%d%.]+)([%+%-%*/])([%d%.]+)")
- local res = performOperation(operand1,operand2,operator)
- pcall(function()
- t.Text = res
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement