Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Definição da tela
- local YukiWare = Instance.new("ScreenGui")
- YukiWare.Name = "YukiWare"
- YukiWare.Parent = game.CoreGui
- YukiWare.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- -- Definição do botão
- local Main = Instance.new("Frame")
- Main.Name = "Main"
- Main.Parent = YukiWare
- Main.ClipsDescendants = false
- Main.AnchorPoint = Vector2.new(0.5, 0.5)
- Main.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
- Main.Position = UDim2.new(0.1, 40, 0.1, -52)
- Main.Size = UDim2.new(0, 32, 0, 32)
- Main.Transparency = 1
- local Corner = Instance.new("UICorner")
- Corner.Name = "Corner"
- Corner.Parent = Main
- CornerRadius = 0,4
- local Button = Instance.new("TextButton")
- Button.Name = "Button"
- Button.Parent = Main
- Button.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Button.Position = UDim2.new(0, 0, 0, 0)
- Button.Size = UDim2.new(1, 0, 1, 0)
- Button.Font = Enum.Font.SourceSans
- Button.Text = "YW"
- Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- Button.TextSize = 19
- Button.Transparency = 0.4
- Button.TextTransparency = 0
- local ButtonCorner = Instance.new("UICorner")
- Corner.Name = "Corner"
- Corner.Parent = Button
- CornerRadius = 0,4
- -- Variáveis para controle de arrastar
- local dragging
- local dragStart
- local startPos
- -- Função para iniciar o arrastar
- local function startDrag(input)
- dragging = true
- startPos = Main.Position
- dragStart = input.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- -- Função para atualizar a posição durante o arrastar
- local function updateDrag(input)
- if dragging then
- local delta = input.Position - dragStart
- Main.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- end
- -- Conectar eventos de mouse para arrastar o botão
- Button.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- startDrag(input)
- end
- end)
- Button.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- updateDrag(input)
- end
- end)
- Button.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- -- Função para enviar o evento de tecla ao pressionar o botão
- Button.MouseButton1Click:Connect(function()
- game:GetService("VirtualInputManager"):SendKeyEvent(true, "LeftControl", false, game)
- end)
- -- Animação de deslizamento do botão
- Button.MouseEnter:Connect(function()
- Button.Size = UDim2.new(1.1, 0, 1.1, 0)
- Button.Position = UDim2.new(-0.05, 0, 0, 0)
- end)
- Button.MouseLeave:Connect(function()
- Button.Size = UDim2.new(1, 0, 1, 0)
- Button.Position = UDim2.new(0, 0, 0, 0)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement