gui.lua
gui.lua
new("ScreenGui")
local TextButton = Instance.new("TextButton")
local UICorner = Instance.new("UICorner")
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
ScreenGui.Name = "ScreenGui"
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
TextButton.Name = "TextButton"
TextButton.Parent = ScreenGui
TextButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
TextButton.Position = UDim2.new(0.159199998, 0, 0.25920248, 0)
TextButton.Size = UDim2.new(0, 70, 0, 70)
TextButton.Font = Enum.Font.IndieFlower
TextButton.Text = "open"
TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
TextButton.TextSize = 41.000
TextButton.TextWrapped = true
TextButton.Visible = true
UICorner.Parent = TextButton
TextButton.MouseButton1Click:Connect(function()
game:GetService("VirtualInputManager"):SendKeyEvent(true,Enum.KeyCode.LeftControl,f
alse,game)
else
TextButton.Text = "open"
game:GetService("VirtualInputManager"):SendKeyEvent(true,Enum.KeyCode.LeftControl,f
alse,game)
end
end)
frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch) then
dragToggle = true
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
UIS.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or
input.UserInputType == Enum.UserInputType.Touch then
if dragToggle then
updateInput(input)
end
end
end)
end
coroutine.wrap(drag)()
frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or
input.UserInputType == Enum.UserInputType.Touch) then
dragToggle = true
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
UIS.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or
input.UserInputType == Enum.UserInputType.Touch then
if dragToggle then
updateInput(input)
end
end
end)
end
coroutine.wrap(drag2)()