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

How do i make it so when my door opens it will make a sound?

So in my game some of the important features are sound effects so i need someone to help me script it so i can put any sound into the script and then when the door opens it will make the sound.

Here is the model https://www.roblox.com/library/4727006455/Opening-Door

When your done please reply with the finished model/finished script

Thank you so much

2 answers

There is no point in scripting if your asking people to spoon-feed you.

You can simply use :Play() to play a song.

e.g

You insert a Sound/Audio object into the door. Put the door sound id inside the object. It should change to something like "rbxassetid://123456789" now inside the door script find the part where it opens and do script.Sound:Play() (Assuming you put the sound inside the script) which will play the sound.

You can do a sound and use :Play() to play the sound.

For example, lets do an 'Oof' sound if opened. (This thing is I made, not the model, and just example.)

local part = Instance.new("Part", workspace)
local clickdetector = Instance.new("ClickDetector", part)
local sound = Instance.new("Sound")
part.Position = Vector3.new(0,5,0)
part.Size = Vector3.new(10,1,7)
part.BrickColor = BrickColor.Black()
part.Orientation = Vector3.new(0, 90, 90)
part.Anchor = true
sound.SoundId = "rbxassetid://604650009"

clickdetector.MouseClick(function()
	sound:Play()
end)

That's the example, just do something like this, I think it should work.

If you have more question, just comment below :)

2 comments

0

hey jack_roblox2008 i tried many ways but im struggling alot i sent u a message on roblox providing the script, please let me know what im doing wrong through the message thanks again! :D

0

You are missing a :Connect for the Mouse Click

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