Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3.6
- -- Instances:
- local syn4ax = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local TextBox = Instance.new("TextBox")
- local TextButton = Instance.new("TextButton")
- -- Properties:
- syn4ax.Name = "syn4ax"
- syn4ax.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- syn4ax.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- syn4ax.ResetOnSpawn = false
- Frame.Name = "Frame"
- Frame.Parent = syn4ax
- Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Frame.BackgroundTransparency = 0.5
- Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Frame.Position = UDim2.new(0.0565, 0, 0.0727, 0)
- Frame.Size = UDim2.new(0, 448, 0, 221)
- Frame.Visible = false -- Start hidden for toggling
- TextLabel.Name = "TextLabel"
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.BackgroundTransparency = 0.5
- TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel.Size = UDim2.new(0, 448, 0, 31)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = "syn4ax - glass version"
- TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel.TextScaled = true
- TextLabel.TextWrapped = true
- TextBox.Name = "TextBox"
- TextBox.Parent = Frame
- TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
- TextBox.Position = UDim2.new(0, 0, 0.14, 0)
- TextBox.Size = UDim2.new(0, 448, 0, 163)
- TextBox.Font = Enum.Font.SourceSans
- TextBox.Text = ""
- TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextBox.TextSize = 14
- TextButton.Name = "TextButton"
- TextButton.Parent = Frame
- TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
- TextButton.Position = UDim2.new(0, 0, 0.88, 0)
- TextButton.Size = UDim2.new(0, 448, 0, 27)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "Submit"
- TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextButton.TextSize = 14
- -- Scripts:
- local UIS = game:GetService("UserInputService")
- local RS = game:GetService("ReplicatedStorage")
- local MainGameHandler = RS.RemoteEvent -- Reference to the remote event
- -- Submit button functionality
- TextButton.MouseButton1Click:Connect(function()
- if MainGameHandler then
- local inputText = TextBox.Text
- MainGameHandler:FireServer(inputText)
- else
- warn("MainGameHandler not found in ReplicatedStorage.")
- end
- end)
- -- Toggle GUI visibility with a hotkey
- local hotkey = Enum.KeyCode.Insert -- Hotkey for toggling
- local isOpen = false -- Toggle state
- UIS.InputBegan:Connect(function(input, gameProcessed)
- if not gameProcessed and input.KeyCode == hotkey then
- if UIS:GetFocusedTextBox() == nil then
- isOpen = not isOpen
- Frame.Visible = isOpen
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement