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

Help on this script error?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I'm testing if the SoundID has been changed if it did it would play it, but it does not work. And the script is in the Sound

while wait(.1) do
script.Parent.Changed:connect(function(Change)
if Change == "SoundID" then 
script.Parent:Play()
end end)
end

1 answer

Log in to vote
2
Answered by 9 years ago
  1. You do not need a while loop
  2. Use wait() instead of wait(.1), it's faster
  3. It's SoundId not SoundID, lua is CaSe SeNsItIvE.

script.Parent.Changed:connect(function(Change)
    if Change == "SoundID" then 
        script.Parent:Play() --TAB YOUR SCRIPTS!
    end
end)


Hope it helps!(I'm back!)

0
thanks :) Anthony9960 210 — 9y
0
You're welcome! EzraNehemiah_TF2 3552 — 9y
0
You forgot to change it SoundId in your answer! BlueTaslem 18071 — 9y
0
@ BlueTaslem , I think he changes it in another script... EzraNehemiah_TF2 3552 — 9y
Ad

Answer this question