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

DragStopped

The DragStopped event fires when a player stops dragging the object.

Parameters

Name Type Default Description

x

int

The mouse’s x location.

y

int

The mouse’s y location.


Code Samples


GuiObject.DragStopped

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)