How do I make a spring mechanic?

There is nothing wrong with the script. Does it work? Doesn’t work? Any errors?
You need to give us some more context.

Please check Posting guidelines in #Help channel and try to answer all questions mentioned there.