Help with string pad

So I want to make a spring pad that when you step on it then it will close inward.
Ex:
image

And if you step off it will open upwards
Ex:
image

Here is my pad testing place:
Spring pad testing.rbxl (94.6 KB)

You can use Part.Touched and change the position of the spring when the player touches it

local tweenService = game:GetService(“TweenService”)
local tweenInfo = tweenService.New(1)
part = “your button here”
local storedPos = part.Position
local inTween = nil
local outTween = nil

part.Touched:Connect(function(b)
if b.Parent:FindFirstChild(“Humanoid”) then
if outTween ~= nil then
outTween:Stop()
end
local vector = part.Position - vector3.new(0,-1,0)
inTween = tweenService:Create(part, tweenInfo,{Position = vector})
imTween:Play()
end
end)

part.TouchEnded:Connect(function(b)
if b.Parent:FindFirstChild(“Humanoid”) then
if inTween ~= nil then
inTween:Stop()
end
local vector = storedPos
outTweenService:Create(part, tweenInfo,{Position = vector})
outTween:Play()

you might have to change some this, i wrote this on mobile

I know how to tween it but I wanted to know how to use a spring to control it instead

then just do that
balak2j2jejens