Advertisement
goku13l

synapse x ui in roblox

Jan 3rd, 2023
1,901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. -- create a new ScreenGui and add it to the player's PlayerGui
  2. local gui = Instance.new("ScreenGui")
  3. gui.Name = "SynapseUI"
  4. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  5.  
  6. -- create a new Frame and add it to the ScreenGui
  7. local frame = Instance.new("Frame")
  8. frame.Name = "MainFrame"
  9. frame.Size = UDim2.new(0, 300, 0, 200)
  10. frame.Position = UDim2.new(0.5, -150, 0.5, -100)
  11. frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  12. frame.BorderSizePixel = 0
  13. frame.Parent = gui
  14.  
  15. -- create a new TextLabel and add it to the Frame
  16. local label = Instance.new("TextLabel")
  17. label.Name = "TitleLabel"
  18. label.Size = UDim2.new(1, 0, 0, 50)
  19. label.Position = UDim2.new(0, 0, 0, 0)
  20. label.Text = "Synapse X"
  21. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  22. label.TextSize = 36
  23. label.BackgroundTransparency = 1
  24. label.Parent = frame
  25.  
  26. -- create a new TextBox and add it to the Frame
  27. local textBox = Instance.new("TextBox")
  28. textBox.Name = "ScriptBox"
  29. textBox.Size = UDim2.new(1, -20, 1, -70)
  30. textBox.Position = UDim2.new(0, 10, 0, 50)
  31. textBox.Text = "-- Enter your script here"
  32. textBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. textBox.TextSize = 14
  34. textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  35. textBox.BorderSizePixel = 0
  36. textBox.Parent = frame
  37.  
  38. -- create a new TextButton and add it to the Frame
  39. local button = Instance.new("TextButton")
  40. button.Name = "ExecuteButton"
  41. button.Size = UDim2.new(1, -20, 0, 20)
  42. button.Position = UDim2.new(0, 10, 1, -30)
  43. button.Text = "Execute"
  44. button.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. button.TextSize = 14
  46. button.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  47. button.BorderSizePixel = 0
  48. button.Parent = frame
  49.  
  50. -- create a function to execute the script in the TextBox when the button is clicked
  51. function button.MouseButton1Click()
  52.   -- get the script from the TextBox
  53.   local script = textBox.Text
  54.  
  55.   -- load and execute the script
  56.   local success, errorMessage = pcall(loadstring(script))
  57.   if success then
  58.     print("Script executed successfully")
  59.   else
  60.     print("Error: " .. errorMessage)
  61.   end
  62. end
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement