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 8 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.

function onTouch(part)
    script.Parent.Parent.Sound:Play()
end
script.Parent.Touched:connect(onTouch)

1 answer

Log in to vote
0
Answered by 8 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.

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

Answer this question