Advertisement
ProHuilonYTZ

ZYXNEculator - A Calculator made by me but actually ChatGPT's done it.

Sep 29th, 2024
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.31 KB | None | 0 0
  1. -- How to Use?
  2. -- To use this you can enter Math Equations for it to solve this and
  3. -- You also can do it! (idk what but it's made by Chat GPT and what the af bc idk why it did dis shit
  4. -- and
  5. -- just because it happend idk how to explain but you Can only subtract or add lol whether those both two no diving possible
  6. -- even also like that if it would then idk what but im too lazy to fix this because chat gpt
  7. -- always types it so slowly lol
  8. -- the math results are in console
  9. -- and i don't think chat gpt understood me correct enough...
  10.  
  11. -- hes just too lazy i think because in the console the math.equals those all use words instead of numbers lol)
  12. -- and i think its so dumb cuz idk lol to lazy lol
  13. -- alr enjoy the script nobos
  14. local ScreenGui = Instance.new("ScreenGui")
  15. local Frame = Instance.new("Frame")
  16. local Button = Instance.new("TextButton")
  17. local TextBox = Instance.new("TextBox")
  18. local IntroFrame = Instance.new("Frame")
  19. local Circle = Instance.new("ImageLabel")
  20. local Rectangle = Instance.new("ImageLabel")
  21. local TitleText = Instance.new("TextLabel")
  22.  
  23. ScreenGui.Parent = game.CoreGui
  24.  
  25. IntroFrame.Parent = ScreenGui
  26. IntroFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  27. IntroFrame.BackgroundTransparency = 0.8
  28. IntroFrame.Size = UDim2.new(1, 0, 1, 0)
  29.  
  30. Circle.Parent = IntroFrame
  31. Circle.BackgroundTransparency = 1
  32. Circle.Size = UDim2.new(0, 150, 0, 150)
  33. Circle.Position = UDim2.new(0.5, -75, 0.5, -75)
  34. Circle.Image = "rbxassetid://10714612160"
  35. Circle.ImageColor3 = Color3.fromRGB(255, 255, 255)
  36.  
  37. Rectangle.Parent = IntroFrame
  38. Rectangle.BackgroundTransparency = 1
  39. Rectangle.Size = UDim2.new(0, 200, 0, 50)
  40. Rectangle.Position = UDim2.new(0.5, -100, 0.5, -25)
  41. Rectangle.Image = "rbxassetid://10714612160"
  42. Rectangle.ImageColor3 = Color3.fromRGB(255, 255, 255)
  43.  
  44. TitleText.Parent = IntroFrame
  45. TitleText.Text = "ZYXNECULATOR"
  46. TitleText.Font = Enum.Font.GothamBold
  47. TitleText.TextSize = 36
  48. TitleText.TextColor3 = Color3.fromRGB(255, 87, 34)
  49. TitleText.BackgroundTransparency = 1
  50. TitleText.Position = UDim2.new(0.5, -200, 0.4, -100)
  51. TitleText.Size = UDim2.new(0, 400, 0, 100)
  52.  
  53. Frame.Parent = ScreenGui
  54. Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  55. Frame.Size = UDim2.new(0, 300, 0, 200)
  56. Frame.Position = UDim2.new(0.5, -150, 0.5, -100)
  57. Frame.BorderSizePixel = 0
  58. Frame.BackgroundTransparency = 0.2
  59. Frame.Visible = false
  60.  
  61. Button.Parent = Frame
  62. Button.Text = "Calculate"
  63. Button.Position = UDim2.new(0.1, 0, 0.7, 0)
  64. Button.Size = UDim2.new(0.8, 0, 0.2, 0)
  65. Button.Font = Enum.Font.GothamBold
  66. Button.TextSize = 20
  67. Button.TextColor3 = Color3.fromRGB(255, 255, 255)
  68. Button.BackgroundColor3 = Color3.fromRGB(255, 87, 34)
  69. Button.BackgroundTransparency = 0.1
  70. Button.BorderSizePixel = 0
  71. Button.AutoButtonColor = false
  72. Button.ClipsDescendants = true
  73. Button.ZIndex = 2
  74.  
  75. local UICorner = Instance.new("UICorner")
  76. UICorner.CornerRadius = UDim.new(0, 12)
  77. UICorner.Parent = Button
  78.  
  79. local UIGradient = Instance.new("UIGradient")
  80. UIGradient.Parent = Button
  81. UIGradient.Color = ColorSequence.new{
  82.     ColorSequenceKeypoint.new(0.0, Color3.fromRGB(255, 87, 34)),
  83.     ColorSequenceKeypoint.new(1.0, Color3.fromRGB(255, 195, 113))
  84. }
  85. UIGradient.Rotation = 90
  86.  
  87. TextBox.Parent = Frame
  88. TextBox.Position = UDim2.new(0.1, 0, 0.2, 0)
  89. TextBox.Size = UDim2.new(0.8, 0, 0.3, 0)
  90. TextBox.Font = Enum.Font.Gotham
  91. TextBox.TextSize = 20
  92. TextBox.Text = ""
  93. TextBox.PlaceholderText = "Enter math equation"
  94. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  95. TextBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  96. TextBox.BorderSizePixel = 0
  97. TextBox.ClearTextOnFocus = true
  98.  
  99. local TextBoxCorner = Instance.new("UICorner")
  100. TextBoxCorner.CornerRadius = UDim.new(0, 8)
  101. TextBoxCorner.Parent = TextBox
  102.  
  103. local numberToWords = {
  104.     ["1"] = "One",
  105.     ["2"] = "Two",
  106.     ["3"] = "Three",
  107.     ["4"] = "Four",
  108.     ["5"] = "Five",
  109.     ["6"] = "Six",
  110.     ["7"] = "Seven",
  111.     ["8"] = "Eight",
  112.     ["9"] = "Nine",
  113.     ["0"] = "Zero"
  114. }
  115.  
  116. local function toWordFormat(equation, result)
  117.     local wordsEquation = equation:gsub("%d", function(digit)
  118.         return numberToWords[digit] or digit
  119.     end)
  120.     return wordsEquation .. "=" .. numberToWords[tostring(result)] .. "(" .. result .. ")"
  121. end
  122.  
  123. local function introAnimation()
  124.     local duration = 2.59330
  125.     local elapsed = 0
  126.    
  127.     while elapsed < duration do
  128.         local progress = elapsed / duration
  129.         local rotation = math.sin(progress * math.pi * 2) * 360
  130.         Rectangle.Rotation = rotation
  131.         local scale = math.cos(progress * math.pi) * 0.5 + 0.5
  132.         Circle.Size = UDim2.new(0, 150 * scale, 0, 150 * scale)
  133.         Rectangle.Size = UDim2.new(0, 200 * scale, 0, 50 * scale)
  134.         local textColor = Color3.new(1, progress, 0)
  135.         TitleText.TextColor3 = textColor:Lerp(Color3.fromRGB(255, 255, 255), progress)
  136.         elapsed += game:GetService("RunService").RenderStepped:Wait()
  137.     end
  138.    
  139.     TitleText.TextColor3 = Color3.fromRGB(255, 255, 255)
  140.     Frame.Visible = true
  141.     IntroFrame:Destroy()
  142. end
  143.  
  144. introAnimation()
  145.  
  146. local dragging
  147. local dragInput
  148. local dragStart
  149. local startPos
  150.  
  151. local function update(input)
  152.     local delta = input.Position - dragStart
  153.     Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  154. end
  155.  
  156. Frame.InputBegan:Connect(function(input)
  157.     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  158.         dragging = true
  159.         dragStart = input.Position
  160.         startPos = Frame.Position
  161.        
  162.         input.Changed:Connect(function()
  163.             if input.UserInputState == Enum.UserInputState.End then
  164.                 dragging = false
  165.             end
  166.         end)
  167.     end
  168. end)
  169.  
  170. Frame.InputChanged:Connect(function(input)
  171.     if input.UserInputType == Enum.UserInputType.MouseMovement then
  172.         dragInput = input
  173.     end
  174. end)
  175.  
  176. game:GetService("UserInputService").InputChanged:Connect(function(input)
  177.     if input == dragInput and dragging then
  178.         update(input)
  179.     end
  180. end)
  181.  
  182. Button.MouseButton1Click:Connect(function()
  183.     local input = TextBox.Text
  184.     local success, result = pcall(function()
  185.         return loadstring("return " .. input)()
  186.     end)
  187.    
  188.     if success then
  189.         print(input .. " = " .. result)
  190.         print(toWordFormat(input, result))
  191.     else
  192.         print("Error in calculation.")
  193.     end
  194. end)
  195.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement