before you go into the loop with the jump code make y=the height that it looks like it is on the grass then in the jump code make if y>'the same number you chose before' then y='the same number you chose before':g=1:re=0