I fixed this with a texture and showing how to use what frame number you wish,it works,thanks.
sync rate 20
Imw=5 `How many images you want across in the final image
frameskip=2 `How many frames you want skip (so if it's set to 2 it will skip every other frame)
filename$="Goblin" `name of object
sw=screen width()
sh=screen height()
spr=sw/2+100
spb=sh/2+100
spl=sw/2-(spr-sw/2)
spt=sh/2-(spb-sh/2)
color backdrop rgb(0,0,253)
load object filename$+".x",1
load image "Goblin_D2.dds",10000
texture object 1,10000
scale object 1,50,50,50
ox#=camera position x()
oy#=object size y(1)/2
oz#=camera position z()
set ambient light 100
loop object 1,266,303
repeat
set cursor 0,0
print "Click and drag box to set the size of the image"
print "Use up and down keys to center the object"
print "Use left and right keys to zoom in and out"
print "Press return key to compile"
if mouseclick()=1
spr=mousex()
spb=mousey()
spl=sw/2-(spr-sw/2)
spt=sh/2-(spb-sh/2)
endif
a2box spl,spt,spr,spb,rgb(0,255,255)
text spr+1,spb+1,str$(spr-spl)+"x"+str$(spb-spt)
position camera ox#,oy#,oz#
if upkey()=1 then dec oy#,1
if downkey()=1 then inc oy#,1
if keystate(37)=1 then inc oz#,1
if keystate(38)=1 then dec oz#,1
if leftkey()=1 then YRotate Object 1, WrapValue(Object Angle Y(1) - 1)
if rightkey()=1 then YRotate Object 1, WrapValue(Object Angle Y(1) + 1)
until returnkey()=1
stop object 1
set camera to image 0,1,sw,sh
sync
tof=303 //////rem last frame of animation here
maxim=1
for x=266 to tof step frameskip ////////rem x=the first number frame animation here
inc maxim
set object frame 1,x
sync
paste image 1,0,0
get image maxim,spl,spt,spr,spb,1
next x
delete object 1
maxim#=maxim
maxy=int((2-maxim#)/imw)*(spt-spb)
maxx=Imw*(spr-spl)
for x=2 to maxim `Removes any black pixels from the object and converts the background to black
cls 0
paste image x,0,0
for ix=0 to image width(x)
for iy=0 to image height(x)
p=point(ix,iy)
r=rgbr(p)
g=rgbg(p)
b=rgbb(p)
if r+g+b=0 then a2dot ix,iy,rgb(1,1,1)
if r+g=0 and b=253 then a2dot ix,iy,rgb(0,0,0)
next iy
next ix
get image x,0,0,image width(x),image height(x),1
if escapekey()=1 then end
text 0,image height(x),"Compiling.."
sync
next x
cls 0
create bitmap maxim+1,maxx,maxy
for x=2 to maxim
paste image x,xpos,ypos
inc imwidth
inc xpos,spr-spl
if imwidth>imw then inc ypos,spb-spt:xpos=0:imwidth=0
next x
get image maxim+2,0,0,maxx,maxy,1
if file exist(Filename$+".bmp") then delete file Filename$+".bmp"
save image Filename$+".bmp",maxim+2
And this is how I am playing my sprites for new people,not to high jack this thread,I am not,just showing what you can do with this code given.
REM Project: play sprite
REM Created: 5/29/2012 6:02:56 PM
REM
REM ***** Main Source File *****
REM
sync rate 60
hide mouse
create animated sprite 1,"Goblin.bmp",5,3,1
create animated sprite 2,"Goblinwalk.bmp",5,3,2
create animated sprite 3,"Goblinwalkleft.bmp",5,3,3
create animated sprite 4,"Goblinidleleft.bmp",5,3,4
create animated sprite 5,"Goblinattack.bmp",5,2,5
create animated sprite 6,"Goblinattackleft.bmp",5,2,6
load sound "hurt2.wav",1
cls
sprite 1,100,200,1
sprite 2,100,200,2
sprite 3,100,200,3
sprite 4,100,200,4
sprite 5,100,200,5
sprite 6,100,200,6
do
if rightkey()=1 then walk=1:pointme=0
if leftkey()=1 then walk=2:pointme=1
if rightkey()=0 and leftkey()=0 then walk=0
if mouseclick()=1 then attact=1
if walk=0 and pointme=0 and attact=0 then hide sprite 4:hide sprite 3:hide sprite 2:show sprite 1:play sprite 1,1,13,50
if walk=0 and pointme=1 and attact=0 then show sprite 4: hide sprite 3:hide sprite 2:hide sprite 1:play sprite 4,1,13,50
if walk=1 and attact=0 then hide sprite 4:hide sprite 3:hide sprite 1:show sprite 2:play sprite 2,1,13,50:MoveSprite(1,0,1):MoveSprite(2,0,1):MoveSprite(3,0,1):MoveSprite(4,0,1):MoveSprite(5,0,1):MoveSprite(6,0,1)
if walk=2 and attact=0 then hide sprite 4:show sprite 3:hide sprite 1:hide sprite 2:play sprite 3,1,13,50:MoveSprite(1,180,1):MoveSprite(2,180,1):MoveSprite(3,180,1):MoveSprite(4,180,1):MoveSprite(5,180,1):MoveSprite(6,180,1)
if attact=0
hide sprite 5
hide sprite 6
endif
if attact=1 and pointme=0
show sprite 5
play sprite 5,1,10,50
hide sprite 4
hide sprite 3
hide sprite 1
hide sprite 2
endif
attackstop=SPRITE FRAME(5)
if attackstop=10
attact=0
SET SPRITE FRAME 5, 1
endif
if attackstop=4
play sound 1
endif
if attact=1 and pointme=1
show sprite 6
play sprite 6,1,10,50
hide sprite 4
hide sprite 3
hide sprite 1
hide sprite 2
endif
attackstop2=SPRITE FRAME(6)
if attackstop2=10
attact=0
SET SPRITE FRAME 6, 1
endif
if attackstop2=4
play sound 1
endif
rem print "sprite frame ",sprite frame(1)
loop
end
FUNCTION MoveSprite(spriteNum,angle,speed)
x = sprite x(spriteNum)
y = sprite y(spriteNum)
img = sprite image(spriteNum)
xAdd = cos(angle) * speed
yAdd = sin(angle) * speed
sprite spriteNum, x+xAdd, y+yAdd, img
ENDFUNCTION
my signature keeps being erased by a mod So this is my new signature.