I’m new to scripting and I’m trying and i have a script but i cant figure out why my audio wont work.
-Here’s The Script
local Click = game.Workspace.Button.ClickDetector
script.LocalScript.Disabled=true
Click.MouseClick:Connect(function ()
game.Workspace.Button.CanTouch = false
print(“clicked”)
game.Workspace[“futuristic / scifi button click sound effect”]:Play()
task.wait(3)
game.Workspace[“Nintendo Switch Click SFX”]:Play()
script.LocalScript.Disabled=false
end)
–The script is in StarterGui and the SFX is in Workspace
Probably code isn’t the problem.
Just make sure the script is a Script, Not LocalScript.
Gotta, LocalScript doesn’t have a Disabled property, Did you use an AI to generate a code for you?
2112Jay
(2112Jay)
February 11, 2024, 1:39am
4
That is actually a thing. See that in gHub codes sometimes.
@ WindyTundra
Why is this script.LocalScript.Disabled=false
Is there a script named LocalScript inside the script running this?
vxsqi
(vxsqi)
February 11, 2024, 1:56am
5
Yes it is, you can even check the documentation.
sorry about responding so late but it IS a script it just activates a local script
and no i didnt use ai to generate my code lol
figured it out, i forgot to put the audio on “Playing”
1 Like
As you said:
.Disabled exists, it’s just older.
You (probably) should use .Enabled.
I found out ClickDetector works on LocalScript. (lol)
It doesn’t need to be a script, unless you want everyone to hear the sound.
Where’s the localscript located in? It doesnt work when parented to workspace directly, It works when it’s inside the character, ReplicatedFirst or PlayerGui/BackPack/PlayerScripts
:Play() sets the audio on Playing automatically.
system
(system)
Closed
February 25, 2024, 2:01pm
11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.