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

Why is my script not working?

I want it to play music when the scripts parent is touched but it doesn't work can you fix my script?

music = game.Workspace.Music

function onTouch()
	music:Play()
end

script.Parent.Touched(onTouch)

1 answer

✓ Accepted answer

You forgot the :connect on the connection line, use this:

music = game.Workspace.Music

function onTouch()
	music:Play()
end

script.Parent.Touched:connect(onTouch)

2 comments

1

Whoops I made a stupid but simple mistake thanks!

0

It's alright, I make mistakes like that sometimes!

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