Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
fastlocks -10
4 years ago

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

Closed as Not Constructive by GeneratedScript, Filipalla, and RayCurse

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
DrShockz 233 Moderation Voter
4 years ago

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.

Ad
Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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 :)

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 fastlocks -10 — 4y
0
You are missing a :Connect for the Mouse Click Filipalla 504 — 4y