I've been trying to learn how to script and I've done some basic stuff and edited some scripts. A friend of mine told me instead of having several scripts inside parts, it'll be better to have them in server script storage. I edited this script I had and put it in server script storage, first error I received was "touched is not a valid member of ServerScriptStorage". I don't know how to fix this but what I'm wanting to do is that when a player comes in touch with the block "Pendulum", the block is no longer anchored and it starts moving.
-- Unanchor OBSTACLES
h = workspace.Res1.OBS41.DoublePendulum.Pendulum
function touch(hit)
wait (0.01)
h.Anchored = false
end
script.Parent.Touched:Connect(touch)

1 comment
i would recommend you to put the script inside the part though