i need help making my magic rpg
hi if you want to help tell me i broke the code and cant figure out how to make it display the sprites like its supposed to on the playergui
init = function() play = "play" player = "player"+arrownum+spritedir+spriteud left=0 right=1 up = 0 down = 1 play1 = sprites["play"] leftarrow = sprites["leftarrow"] rightarrow = sprites["rightarrow"] homepage = true playergui = false game = false arrownume = 1 arrownum = "1" skins = 2 end
update = function() screen.clear("rgb(160,87,197)") if right== 1 then spritedir = "r" end if left == 1 then spritedir = "l" end if up == 1 then spriteud = "u" spritedir = "u" end if down == 1 then spriteud = "d" end if playergui == true then if keyboard.LEFT then left = 1 right = 0 end if keyboard.RIGHT then left = 0 right = 1 end if keyboard.UP then up = 1 down = 0 end if keyboard.DOWN then up = 0 down = 1 end end if homepage == true then if mouse.x >= 0-play1.width/2 and mouse.x <= play1.width/2 and mouse.y >= 0-play1.height/2 and mouse.y <= play1.height/2 then if mouse.pressed then screen.drawSprite("play2",0,0,100,100) sleep(200) homepage = false playergui=true end end end if playergui == true then screen.fillRect(-150,0,100,35,"rgb(197,138,22)") screen.drawText("Start",-150,0,40,100,20) screen.drawRect(-150,0,100,35,"rgb(0,0,0)") if mouse.x >= -150-50 and mouse.x <= -150+50 and mouse.y <= 0+35/2 and mouse.y >= 0-35/2 then if mouse.pressed then playergui = false end end end if mouse.x >= 20-16-leftarrow.width/12 and mouse.x <= 26 and mouse.y>= 0-leftarrow.height/2 and mouse.y <= leftarrow.height/2 then if mouse.pressed and 0+1<arrownume then arrownume-=1 sleep(200) end end if mouse.x >= 153+10-rightarrow.width/12 and mouse.x <= 153+30+rightarrow.width/12 and mouse.y>= 0-rightarrow.height/2 and mouse.y <= rightarrow.height/2 then if mouse.pressed and skins>arrownume then arrownume += 1 sleep(200) end end arrownum = arrownume.toString() end
draw = function()
if homepage == true then screen.drawSprite(play,0,0,100,100) end if playergui == true then screen.fillRoundRect(90,0,200,200,30,"rgb(197,138,22)") screen.drawSprite("leftarrow",20,-20,100,100) screen.drawSprite("rightarrow",153,-21,100,100) screen.drawSprite(player,113,0,200,200) end end