You also might trying using the commands GetContactSpriteID1 and GetContactSpriteID2 instead of the loop:
// you are only doing something if the pointer is pressed
// so check that first
if getpointerpressed() = 1
// check to see if there has been a contact
if GetSpriteFirstContact( player ) = 1
// get contact sprite ID
cont2 = GetContactSpriteID2()
// check for being one of the platforms
// nested ifs are used because Tier 1 doesn't
// properly stop parsing an if statement if the
// first part fails
if cont2 >= cavemidplatmin
if cont2 <= cavemidplatmax
// jump player
setspritephysicsvelocity (player,0,jumpamount)
endif
endif
endif
endif
EDIT: fixed usage a bit and removed the loop, since you only need to check if the id is in range.
Cheers,
Ancient Lady
AGK Community Tester