
616 Views
1.7k Executions
Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
.
local screenGui = Instance.new("ScreenGui")
screenGui.ResetOnSpawn = false
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 550, 0, 23)
frame.Position = UDim2.new(0.305, 0, 0.1, 0)
frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
frame.BorderSizePixel = 1
frame.BorderColor3 = Color3.fromRGB(221, 221, 221)
frame.Active = true
frame.Draggable = true
frame.Parent = screenGui
local UserInputService = game:GetService("UserInputService")
local gui = frame
local dragging
local dragInput
local dragStart
local startPos
local function update(input)
local delta = input.Position - dragStart
gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
gui.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = gui.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
Comments
0Log in to join the conversation. Login
No comments yet. Be the first!








