I am currently working on an obby, and I want a feature where if you touch the next spawnpoint then there will be a local barrier which blocks you off from going back. I have tried putting local scripts inside the barrier but it doesn’t work. Right now this is my code in a server script:
--Variables
barrier = workspace.Stages.Jumps.Barrier
--Commands
script.Parent.Touched:Connect(function(hit)
barrier.CanCollide = true
end)