great thanks!
how do I make sure my drag script works? (It does not, drag is at the bottom)
--[[
Roblox2Lua
----------
This code was generated using
Deluct's Roblox2Lua plugin.
]]--
--// Instances
local insider = Instance.new("ScreenGui")
insider.Name = "Insider"
insider.Parent = game.StarterGui
local main = Instance.new("Frame")
main.BackgroundColor3 = Color3.new(0.133333, 0.133333, 0.133333)
main.Position = UDim2.new(0.280448705, 0, 0.271659315, 0)
main.Size = UDim2.new(0, 548, 0, 311)
main.Name = "main"
main.Parent = insider
local uicorner = Instance.new("UICorner")
uicorner.CornerRadius = UDim.new(0, 14)
uicorner.Parent = main
local uistroke = Instance.new("UIStroke")
uistroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
uistroke.Color = Color3.new(0.784314, 0.784314, 0.784314)
uistroke.Parent = main
local drag = Instance.new("LocalScript")
drag.Name = "drag"
drag.Parent = main
local line = Instance.new("Frame")
line.BackgroundColor3 = Color3.new(0.392157, 0.392157, 0.392157)
line.BorderSizePixel = 0
line.Position = UDim2.new(-0.000573151279, 0, 0.825337231, 0)
line.Size = UDim2.new(0, 548, 0, 1)
line.Name = "line"
line.Parent = main
local buttons = Instance.new("Frame")
buttons.BackgroundColor3 = Color3.new(1, 1, 1)
buttons.BackgroundTransparency = 1
buttons.Position = UDim2.new(0, 0, 0.828552663, 0)
buttons.Size = UDim2.new(0, 547, 0, 53)
buttons.Name = "buttons"
buttons.Parent = main
local home = Instance.new("TextButton")
home.Font = Enum.Font.SourceSans
home.Text = ""
home.TextColor3 = Color3.new(0, 0, 0)
home.TextSize = 14
home.BackgroundColor3 = Color3.new(1, 1, 1)
home.Position = UDim2.new(0.0218777936, 0, 0.213795975, 0)
home.Size = UDim2.new(0, 30, 0, 30)
home.Name = "Home"
home.Parent = buttons
local uistroke_2 = Instance.new("UIStroke")
uistroke_2.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
uistroke_2.Color = Color3.new(0.784314, 0.784314, 0.784314)
uistroke_2.Parent = home
local uicorner_2 = Instance.new("UICorner")
uicorner_2.CornerRadius = UDim.new(0, 7)
uicorner_2.Parent = home
local uigradient = Instance.new("UIGradient")
uigradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.new(0.313726, 0.313726, 0.313726)), ColorSequenceKeypoint.new(1, Color3.new(0.0823529, 0.0823529, 0.0823529))})
uigradient.Rotation = -100
uigradient.Parent = home
local home_2 = Instance.new("ImageButton")
home_2.Image = "rbxassetid://3926305904"
home_2.ImageRectOffset = Vector2.new(964, 204)
home_2.ImageRectSize = Vector2.new(36, 36)
home_2.BackgroundTransparency = 1
home_2.Position = UDim2.new(0.0782051012, 0, 0.0763583183, 0)
home_2.Size = UDim2.new(0, 25, 0, 25)
home_2.ZIndex = 2
home_2.Name = "home"
home_2.Parent = home
local local_player = Instance.new("TextButton")
local_player.Font = Enum.Font.SourceSans
local_player.Text = ""
local_player.TextColor3 = Color3.new(0, 0, 0)
local_player.TextSize = 14
local_player.BackgroundColor3 = Color3.new(1, 1, 1)
local_player.Position = UDim2.new(0.0986602455, 0, 0.213795975, 0)
local_player.Size = UDim2.new(0, 30, 0, 30)
local_player.Name = "LocalPlayer"
local_player.Parent = buttons
local uistroke_3 = Instance.new("UIStroke")
uistroke_3.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
uistroke_3.Color = Color3.new(0.784314, 0.784314, 0.784314)
uistroke_3.Parent = local_player
local uicorner_3 = Instance.new("UICorner")
uicorner_3.CornerRadius = UDim.new(0, 7)
uicorner_3.Parent = local_player
local uigradient_2 = Instance.new("UIGradient")
uigradient_2.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.new(0.313726, 0.313726, 0.313726)), ColorSequenceKeypoint.new(1, Color3.new(0.0823529, 0.0823529, 0.0823529))})
uigradient_2.Rotation = -100
uigradient_2.Parent = local_player
local home_3 = Instance.new("ImageButton")
home_3.Image = "rbxassetid://3926305904"
home_3.ImageRectOffset = Vector2.new(964, 204)
home_3.ImageRectSize = Vector2.new(36, 36)
home_3.BackgroundTransparency = 1
home_3.Position = UDim2.new(0.0782051012, 0, 0.0763583183, 0)
home_3.Size = UDim2.new(0, 25, 0, 25)
home_3.ZIndex = 2
home_3.Name = "home"
home_3.Parent = local_player
--//Modules
local modules = {}
--// Scripts
-- drag
task.spawn(function()
local script = drag
local oldreq = require
local function require(target)
if modules[target] then
return modules[target]()
end
return oldreq(target)
end
local UserInputService = game:GetService("UserInputService")
local gui = main
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
end)
gui.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
if gui.Visible then
update(input)
end
end
end)
end)