How to detect if a player is going up

Hi I want to create a script to detect if the player is going up(like if he is on a raising platform) I did something like that(see the pics below)
It doest not seem to work odly enought , any Idea how and how to do it?:

Thanks
​​​​​​​