How do i make hold click UI make sound1 and drop UI make sound2

For Expain Here is Video: [ignore sound that mouse Touch the button]


This is Mine:

Here is Script:

--local buttondown = script.Parent.buttondown--
local buttonup = script.Parent.buttonup

script.Parent.MouseButton1Click:Connect(function()
--script.Parent.MouseButton2Click:Connect(function()--
	buttonup:Play()
end)

Hello there,

Instead of using the MouseButton1Click event you could use the MouseButton1Up and MouseButton1Down event to play the “buttonDown” sound when the mouse button is being pressed and the “buttonUp” sound if the mouse button is released.

local buttonUp: Sound = script.Parent.buttonUp
local buttonDown: Sound = script.Parent.buttonDown

script.Parent.MouseButton1Down:Connect(function()
    buttonDown:Play()
end)

script.Parent.MouseButton1Up:Connect(function()
    buttonUp:Play()
end)

I hope that this helped you along with your problem.
Feel free to ask questions.

  • DosenSuppe2_0
1 Like

Thank you so much!, For second i think something wrong but i just realize that you just typing “buttonDown” & “buttonUp” instead “buttondown” & “buttonup”
Btw Thank you so much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.