Hi, welcome to the DBC forums.
I think you could use the STOP OBJECT command, like this:
sync on : sync rate 60
load object "YourObject.x",1
repeat
oframe = object frame(1)
if rightkey() = 1
if oframe < 1 or oframe > 10
stop object 1
loop object 1,1,10
endif
else
rem rightkey() = 0
if oframe < 11 or oframe > 20
stop object 1
loop object 1,11,20
endif
endif
oframe = object frame(1)
text 10,10,"frame: " + str$(oframe)
sync
until spacekey() = 1
end
You would need to change the object name from "YourObject.x" to the actual name and pathway for your object.
RIGHTKEY() is going to return 1 if the key is pressed and 0 if not, so you should not have to test for it twice. The example I have given shows this.
The code checks to see if the current object frame is within the animation that you want and only resets it when needed. It exits when the spacebar is pressed.
Hope this is helpful.
So many games to code.....so little time.