I edited the code that culmore30 gave and made sure that the platform did not rotate if the object when to the sides of the platform. I also made the elevator go up and down smoothly.
sync on
sync rate 60
phy start
phy set gravity 0,-20,0
`This will be the ground.
make object cube 1,100
scale object 1,100,1,100
phy make rigid body static box 1
`Now we make a player object. I'm not gonna make
`controls for it, but I'm assuming you have that set up.
make object cube 2,2
color object 2,rgb(255, 0, 0)
`Do your positioning BEFORE setting it up with physics.
position object 2,0,5,0
phy make rigid body dynamic box 2
`Now we'll make an elevator cube.
make object cube 3,30
scale object 3,30,2,30
color object 3,rgb(0, 0, 0)
position object 3,0,2,0
phy make rigid body dynamic box 3
phy set rigid body gravity 3,0
do
phy set rigid body linear velocity 3,0,vil#,0
phy set rigid body rotation 3,0,0,0
if object position y(3) => 20
if vil# > -10
vil#=vil#-0.25
endif
endif
if object position y(3) =< 10
if vil# < 10
vil#=vil#+0.25
endif
endif
control camera using arrowkeys 0,0.25,0.75
phy update
sync
loop