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

Why wont this local script work?

Asked by 9 years ago

This script is a local script inside of the baseplate it is supposed to make a sound play when touched. This does not work.

1function onTouch(part)
2    script.Parent.Parent.Sound:Play()
3end
4script.Parent.Touched:connect(onTouch)

1 answer

Log in to vote
0
Answered by 9 years ago

Local scripts can only be run on the client. Use a regular script for this, and preferably put it in ServerScriptStorage, it would like this.

1--In serverscriptstorage
2workspace.Baseplate.Touched:connect(function()
3    workspace.Sound:Play() --I assume this is where it is?
4end)
Ad

Answer this question