While clicking idea

  1. What do you want to achieve? I want to play the sound while clicked.

  2. What is the issue? I don’t know how to do that.

while true do
sound:play
sound:stop

like this.

When you click your mouse? Be more specific.

The sound only comes out during the long press. (Translate.) long press is mouse click. I am making the buzzer system for the train.

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

local holding = false

Mouse.Button1Down:Connect(function()
	holding = true
end)

Mouse.Button1Up:Connect(function()
	holding = false
end)

while true do
	if holding == true then
		sound:Play()
        task.wait(sound.TimeLength)
	else
		break
	end
end
2 Likes

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