Make the gui able to move so when you try to move the gui it will move smoothly local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = nil
local dragInput = nil
local dragStart = nil
local startPos = nil
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
7 answers
```lua
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = false
local dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if dragging and input == dragInput then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
ResolverButton.MouseButton1Click:Connect(toggleResolver)
```
This code snippet has been optimized to make the dragging mechanism smoother. By checking `dragging` first before updating the `Frame` position and ensuring that `update(input)` is continuously called while dragging, the GUI should now move in a more fluid manner. The order of conditioned checks and connections remains intact for responsiveness and performance.
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = nil
local dragInput = nil
local dragStart = nil
local startPos = nil
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
```lua
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = false
local dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if dragging and input == dragInput then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
ResolverButton.MouseButton1Click:Connect(toggleResolver)
```
In this code snippet, we've incorporated the draggable functionality into the `Frame`. Now, when you click and drag the `Frame` with the mouse, it will move smoothly across the screen.
Here's your updated code:
```lua
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local CloseButton = Instance.new("TextButton") -- New Close button
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = false
local dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if dragging and input == dragInput then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Close Button
CloseButton.Parent = Frame
CloseButton.Text = "Close" -- Initial text
CloseButton.TextColor3 = Color3.new(1, 1, 1) -- White
CloseButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CloseButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CloseButton.Position = UDim2.new(0, 0, 0.59, 0) -- Right below the Resolver button
CloseButton.Font = Enum.Font.SourceSans
CloseButton.TextScaled = true
CloseButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Function to close the GUI
local function closeGUI()
ScreenGui:Destroy()
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
ResolverButton.MouseButton1Click:Connect(toggleResolver)
CloseButton.MouseButton1Click:Connect(closeGUI)
```
In this updated code, a new `CloseButton` is added below the `ResolverButton`. When the `CloseButton` is clicked, it triggers the `closeGUI` function, which destroys the `ScreenGui` and thereby closes the GUI.
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = nil
local dragInput = nil
local dragStart = nil
local startPos = nil
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
Below is your updated script with the "Close" button functionality added:
```lua
local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Credits = Instance.new("TextLabel")
local CamlockButton = Instance.new("TextButton")
local ResolverButton = Instance.new("TextButton")
local CloseButton = Instance.new("TextButton") -- New Close button
local UICorner = Instance.new("UICorner")
-- Parent the GUI to the Player's PlayerGUI
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
-- Set up the Frame
Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Frame.Size = UDim2.new(0.1, 50, 0.5, 100) -- Adjusted to a medium size
Frame.Position = UDim2.new(0.45, -25, 0.25, -50) -- Center the GUI after adjusting size
Frame.BorderSizePixel = 0 -- Remove border lines
-- Add rounded corners to Frame
UICorner.CornerRadius = UDim.new(0, 12) -- Adjust the value for roundness (12 is an example)
UICorner.Parent = Frame
-- Make the Frame draggable
local dragging = nil
local dragInput = nil
local dragStart = nil
local startPos = nil
local function update(input)
local delta = input.Position - dragStart
Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
Frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
Frame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
-- Set up the Title
Title.Parent = Frame
Title.Text = "Awaken v3"
Title.TextColor3 = Color3.new(1, 1, 1) -- White
Title.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Title.BackgroundTransparency = 1 -- Make the background transparent
Title.Size = UDim2.new(1, 0, 0.2, 0)
Title.Position = UDim2.new(0, 0, 0, 0)
Title.Font = Enum.Font.SourceSans
Title.TextScaled = true
Title.BorderSizePixel = 0 -- Remove border lines
-- Set up the Camlock Button
CamlockButton.Parent = Frame
CamlockButton.Text = "Camlock" -- Initial text
CamlockButton.TextColor3 = Color3.new(1, 1, 1) -- White
CamlockButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CamlockButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CamlockButton.Position = UDim2.new(0, 0, 0.25, 0) -- Right below the Title
CamlockButton.Font = Enum.Font.SourceSans
CamlockButton.TextScaled = true
CamlockButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Resolver Button
ResolverButton.Parent = Frame
ResolverButton.Text = "Resolver" -- Initial text
ResolverButton.TextColor3 = Color3.new(1, 1, 1) -- White
ResolverButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
ResolverButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
ResolverButton.Position = UDim2.new(0, 0, 0.42, 0) -- Right below the Camlock button
ResolverButton.Font = Enum.Font.SourceSans
ResolverButton.TextScaled = true
ResolverButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Close Button
CloseButton.Parent = Frame
CloseButton.Text = "Close" -- Initial text
CloseButton.TextColor3 = Color3.new(1, 1, 1) -- White
CloseButton.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
CloseButton.Size = UDim2.new(1, 0, 0.15, 0) -- Smaller size
CloseButton.Position = UDim2.new(0, 0, 0.59, 0) -- Right below the Resolver button
CloseButton.Font = Enum.Font.SourceSans
CloseButton.TextScaled = true
CloseButton.BorderSizePixel = 0 -- Remove border lines
-- Set up the Credits
Credits.Parent = Frame
Credits.Text = "Credits: All credits go to Awaken"
Credits.TextColor3 = Color3.new(1, 1, 1) -- White
Credits.BackgroundColor3 = Color3.new(0, 0, 0) -- Black
Credits.BackgroundTransparency = 1 -- Make the background transparent
Credits.Size = UDim2.new(1, 0, 0.2, 0)
Credits.Position = UDim2.new(0, 0, 0.8, 0)
Credits.Font = Enum.Font.SourceSans
Credits.TextScaled = true
Credits.BorderSizePixel = 0 -- Remove border lines
-- Function to toggle Camlock button state
local function toggleCamlock()
if CamlockButton.Text == "Camlock" or CamlockButton.Text == "Camlock OFF" then
CamlockButton.Text = "Camlock ON"
else
CamlockButton.Text = "Camlock OFF"
end
end
-- Function to toggle Resolver button state
local function toggleResolver()
if ResolverButton.Text == "Resolver" or ResolverButton.Text == "Resolver OFF" then
ResolverButton.Text = "Resolver ON"
else
ResolverButton.Text = "Resolver OFF"
end
end
-- Function to close the GUI
local function closeGUI()
ScreenGui:Destroy()
end
-- Connect the toggle functions to the button click events
CamlockButton.MouseButton1Click:Connect(toggleCamlock)
ResolverButton.MouseButton1Click:Connect(toggleResolver)
CloseButton.MouseButton1Click:Connect(closeGUI)
```
In this updated code, a new `CloseButton` is added below the `ResolverButton`. When the `CloseButton` is clicked, it triggers the `closeGUI` function, which destroys the `ScreenGui` and thereby closes the GUI.