I have been trying to make an obby and, i have been trying to make a script so each time a player touches the checkpoint it raises the stagevalue and each time the stagevalue is increased it will spawn it to that checkpoint. So if stagevalue is 1 then the player spawns at the first level checkpoint.
And here is my script:
stagevalue = 0
workspace.Stages.Stage1.Touched:Connect(function()
stagevalue = stagevalue + 1
end)
if stagevalue == 1 then
print("it works")
end
I touch the first checkpoint so that it prints out "it works". But nothing... This is not the whole script, this is the place of the script where the problem is located.
In my workspace i have a folder called Stages and in it a folder called Stage1 that contains the checkpoint part.

4 comments
can you use the ~~~~~~~~~~~~ for the script and not the print? I don't understand the script at all, it's messed
the print is just used so i can verify if the script works. If it prints then it works, if not then it does not work.
LikeToScript, the script contains no errors but when i spawn it prints out "It works" but i still have not touched the first checkpoint.