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

Help on this script error?

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

✓ Accepted answer
  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!)

4 comments

0

thanks :)

0

You're welcome!

0

You forgot to change it SoundId in your answer!

0

@ BlueTaslem , I think he changes it in another script...

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