Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i need a script that plays a certain music when a certain block is touched?

and it shouldnt stop playing the music until you stop touching the block

1 comment

0

Use the touched and touchended events

1 answer

We're here to help, not give scripts. But I have a suggestion on how you would do this.

You would need to use the Touched event, and after the player touches the brick a sound will play. Here is an example:

brick.Touched:connect(function(part)
	if part.Parent:findFirstChild("Humanoid") then
		-- do code
	elseif part.Parent.Parent:findFirstChild("Humanoid") -- just incase the accessory hit the brick.
		-- do code
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.