AugusTH

.

Dec 10th, 2023 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. game.StarterGui:SetCore("SendNotification", {
  2. Title = "Credit To : Augus X";
  3. Text = "Script Loaded!";
  4. Icon = "rbxthumb://type=Asset&id=6038460241&w=150&h=150";
  5. } )
  6.  
  7. -- Calculate the center of the screen
  8. local screenWidth = game:GetService("Workspace").CurrentCamera.ViewportSize.X
  9. local screenHeight = game:GetService("Workspace").CurrentCamera.ViewportSize.Y
  10. local centerX = screenWidth / 2
  11. local centerY = screenHeight / 2
  12.  
  13. -- Define the size of the GUI for Android tablets (adjust as needed)
  14. local guiWidth = 200
  15. local guiHeight = 150
  16.  
  17. -- Create a ScreenGui
  18. local gui = Instance.new("ScreenGui")
  19. gui.Name = "ScriptEditor"
  20. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  21. gui.ResetOnSpawn = false
  22.  
  23. -- Create a Frame for the script editor (big-sized tab)
  24. local frame = Instance.new("Frame")
  25. frame.Size = UDim2.new(0, guiWidth, 0, guiHeight)
  26. frame.Position = UDim2.new(0, centerX - (guiWidth / 2), 0, centerY - (guiHeight / 2))
  27. frame.BackgroundColor3 = Color3.new(1, 1, 1) -- Red color for the tab
  28. frame.Active = true
  29. frame.Draggable = true -- Make the frame draggable
  30. frame.Parent = gui
  31.  
  32. -- Create a label for the tab ("FireX")
  33. local nameLabel = Instance.new("TextLabel")
  34. nameLabel.Size = UDim2.new(1, 0, 0, 30)
  35. nameLabel.Position = UDim2.new(0, 0, 0, 0)
  36. nameLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  37. nameLabel.TextColor3 = Color3.new(0, 0, 0)
  38. nameLabel.Font = Enum.Font.Cartoon
  39. nameLabel.TextSize = 20
  40. nameLabel.Text = "Simple Executor Gui"
  41. nameLabel.Parent = frame
  42.  
  43. -- Create a TextBox for script input
  44. local scriptInput = Instance.new("TextBox")
  45. scriptInput.Size = UDim2.new(1, -20, 1, -90)
  46. scriptInput.Position = UDim2.new(0, 10, 0, 40)
  47. scriptInput.BackgroundColor3 = Color3.new(0, 0, 0)
  48. scriptInput.TextColor3 = Color3.new(1, 1, 1)
  49. scriptInput.Font = Enum.Font.Code
  50. scriptInput.PlaceholderText = "Script Here..."
  51. scriptInput.TextSize = 10
  52. scriptInput.TextWrapped = true
  53. scriptInput.Parent = frame
  54.  
  55. -- Create a "Go" button
  56. local goButton = Instance.new("TextButton")
  57. goButton.Size = UDim2.new(0, 160, 0, 30)
  58. goButton.Position = UDim2.new(0.55, -90, 1.05, -50)
  59. goButton.BackgroundColor3 = Color3.new(0, 1, 0)
  60. goButton.Font = Enum.Font.Cartoon
  61. goButton.Text = "Execute"
  62. goButton.TextSize = 20
  63. goButton.Parent = frame
  64.  
  65. local isDragging = false
  66. local offset = Vector2.new(0, 0)
  67.  
  68. -- Function to execute the entered script
  69. local function executeScript()
  70. local scriptText = scriptInput.Text
  71. local success, errorMessage = pcall(function()
  72. loadstring(scriptText)() -- Execute the Lua code
  73. end)
  74.  
  75. if not success then
  76. warn("Script execution error: " .. errorMessage)
  77. end
  78. end
  79.  
  80. -- Function to handle GUI dragging
  81. frame.InputBegan:Connect(function(input)
  82. if input.UserInputType == Enum.UserInputType.Touch and input.UserInputType == Enum.UserInputType.MouseButton1 then
  83. isDragging = true
  84. offset = input.Position - frame.Position
  85. end
  86. end)
  87.  
  88. frame.InputChanged:Connect(function(input)
  89. if isDragging and (input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseMovement) then
  90. frame.Position = UDim2.new(0, input.Position.X - offset.X, 0, input.Position.Y - offset.Y)
  91. end
  92. end)
  93.  
  94. frame.InputEnded:Connect(function(input)
  95. if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
  96. isDragging = false
  97. end
  98. end)
  99.  
  100. goButton.MouseButton1Click:Connect(executeScript)
Advertisement
Add Comment
Please, Sign In to add comment