PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

DragStopped

This event fires when a player stops dragging the object.

See also

  • GuiObject/DragBegin

Parameters

Name Type Default Description

x

int

The mouse’s x screen location in pixels, relative to the top left corner of the screen

y

int

The mouse’s y screen location in pixels, relative to the top left corner of the screen


Code Samples


(Deprecated) Print the Position of a GUI When Dragging Stops

The below example assumes it’s within a GuiObject such as a TextButton, and that the GuiObject/Draggable property is set to true. It will print the X and Y of where the player stopped dragging the GUI. For example, if the player were to stop dragging the object at 189, 180 the below would print The player stopped dragging the GuiObject at (189, 180)

 script.Parent.DragStopped:Connect(function(X, Y)
    print(("The player stopped dragging the GuiObject at (%i, %i)"):format(X, Y))
end)