Advertisement
2AreYouMental110

Total Roblox Drama Math Mania Put Answer In Box (FIXED)

Aug 20th, 2023 (edited)
1,745
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 1 0
  1. --https://www.roblox.com/games/4889315193/Total-Roblox-Drama
  2. function dostuff(thing)
  3.     print("waiting for maintext")
  4.     thing:WaitForChild("MainText",math.huge)
  5.     print("waiting for box")
  6.     thing:WaitForChild("Box",math.huge)
  7.     local txt = thing.MainText.Text
  8.     local split = string.split(txt," ")
  9.     for i,v in pairs(split) do
  10.         print(i,v)
  11.     end
  12.     local num1 = split[1]
  13.     local plusorminus = split[2]
  14.     local num2 = split[3]
  15.     num1 = tonumber(num1)
  16.     num2 = tonumber(num2)
  17.     local equal
  18.     if plusorminus == "+" then
  19.         equal = num1 + num2
  20.     elseif plusorminus == "-" then
  21.         equal = num1 - num2
  22.     end
  23.     equal = tostring(equal)
  24.     thing.Box.Text = equal
  25.     return true
  26. end
  27. function dogui(gui)
  28.     print(gui.Name)
  29.     if gui.Name == "MathMania" or gui.Name == "GUI" then
  30.         print("mathmania found")
  31.         local loopbreak = false
  32.         for i=1,30 do
  33.             wait(.1)
  34.             if loopbreak then return end
  35.             for i=1,10 do
  36.                 local thing = gui:FindFirstChild(tostring(i))
  37.                 if thing then
  38.                     local result = dostuff(thing)
  39.                     if i == 10 and result == true then
  40.                         loopbreak = true
  41.                         return
  42.                     end
  43.                 end
  44.             end
  45.         end
  46.     end
  47. end
  48. game.Players.LocalPlayer.PlayerGui.ChildAdded:Connect(function(gui)
  49.     dogui(gui)
  50. end)
  51. if game.Players.LocalPlayer.PlayerGui:FindFirstChild("MathMania") then
  52.     dogui(game.Players.LocalPlayer.PlayerGui:FindFirstChild("MathMania"))
  53. end
  54. game:GetService("StarterGui"):SetCore("SendNotification",{Title="Starting",Text="Starting"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement