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

How would I Enable Sounds on a Part when the Part is Enabled?

Asked by 4 years ago
Edited 4 years ago

Lets get to the point. I have a part that either disables or enables the visibilty of a part via script when clicked

To turn on the Laser

local Player = game.Players.LocalPlayer


script.Parent.ClickDetector.MouseClick:connect(function(Player)
    game.Workspace.Damage.Transparency = 0
    game.Workspace.Damage.Script.Disabled = false
end)

Audio

function Audio(Sound)
    if game.Workspace.Damage.Transparency == 0 then
        Sound:Play()
    end
end

local Sound = game.Workspace.Damage.Sound

How would I make it so a Sound will play when the part is visible..

Also for extra help how would you only make it require one button to enable/disable the laser

Thank you for helping!!

1 answer

Log in to vote
0
Answered by 4 years ago

Solved

Ad

Answer this question