K00lkidd81 Gui
K00lkidd81 Gui
-- Create RemoteEvent
local fireEvent = Instance.new("RemoteEvent")
fireEvent.Name = "FireEvent"
fireEvent.Parent = game:GetService("ReplicatedStorage") -- ReplicatedStorage is
used for storing objects that need to be replicated to all clients
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "CustomGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
mousePos = input.Position
framePos = 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
local delta = input.Position - mousePos
frame.Position = UDim2.new(
framePos.X.Scale,
framePos.X.Offset + delta.X,
framePos.Y.Scale,
framePos.Y.Offset + delta.Y
)
end
end)
end