Advertisement
Nick-

test

Jan 23rd, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.6
  3.  
  4. -- Instances:
  5.  
  6. local syn4ax = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9. local TextBox = Instance.new("TextBox")
  10. local TextButton = Instance.new("TextButton")
  11.  
  12. -- Properties:
  13.  
  14. syn4ax.Name = "syn4ax"
  15. syn4ax.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  16. syn4ax.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  17. syn4ax.ResetOnSpawn = false
  18.  
  19. Frame.Name = "Frame"
  20. Frame.Parent = syn4ax
  21. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  22. Frame.BackgroundTransparency = 0.5
  23. Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  24. Frame.Position = UDim2.new(0.0565, 0, 0.0727, 0)
  25. Frame.Size = UDim2.new(0, 448, 0, 221)
  26. Frame.Visible = false -- Start hidden for toggling
  27.  
  28. TextLabel.Name = "TextLabel"
  29. TextLabel.Parent = Frame
  30. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  31. TextLabel.BackgroundTransparency = 0.5
  32. TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  33. TextLabel.Size = UDim2.new(0, 448, 0, 31)
  34. TextLabel.Font = Enum.Font.SourceSans
  35. TextLabel.Text = "syn4ax - glass version"
  36. TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  37. TextLabel.TextScaled = true
  38. TextLabel.TextWrapped = true
  39.  
  40. TextBox.Name = "TextBox"
  41. TextBox.Parent = Frame
  42. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  43. TextBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
  44. TextBox.Position = UDim2.new(0, 0, 0.14, 0)
  45. TextBox.Size = UDim2.new(0, 448, 0, 163)
  46. TextBox.Font = Enum.Font.SourceSans
  47. TextBox.Text = ""
  48. TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  49. TextBox.TextSize = 14
  50.  
  51. TextButton.Name = "TextButton"
  52. TextButton.Parent = Frame
  53. TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  54. TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  55. TextButton.Position = UDim2.new(0, 0, 0.88, 0)
  56. TextButton.Size = UDim2.new(0, 448, 0, 27)
  57. TextButton.Font = Enum.Font.SourceSans
  58. TextButton.Text = "Submit"
  59. TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  60. TextButton.TextSize = 14
  61.  
  62. -- Scripts:
  63.  
  64. local UIS = game:GetService("UserInputService")
  65. local RS = game:GetService("ReplicatedStorage")
  66. local MainGameHandler = RS.RemoteEvent -- Reference to the remote event
  67.  
  68. -- Submit button functionality
  69. TextButton.MouseButton1Click:Connect(function()
  70. if MainGameHandler then
  71. local inputText = TextBox.Text
  72. MainGameHandler:FireServer(inputText)
  73. else
  74. warn("MainGameHandler not found in ReplicatedStorage.")
  75. end
  76. end)
  77.  
  78. -- Toggle GUI visibility with a hotkey
  79. local hotkey = Enum.KeyCode.Insert -- Hotkey for toggling
  80. local isOpen = false -- Toggle state
  81.  
  82. UIS.InputBegan:Connect(function(input, gameProcessed)
  83. if not gameProcessed and input.KeyCode == hotkey then
  84. if UIS:GetFocusedTextBox() == nil then
  85. isOpen = not isOpen
  86. Frame.Visible = isOpen
  87. end
  88. end
  89. end)
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement