- 68
- Posts
- 11
- Years
- Seen Nov 12, 2023
Hello, I have a modified script from help-14, with I can get Items. My script is this:
but, because of this:
I can't save anymore. It the mistake: Save failed....
Without this section the script is okay ...
Code:
def Gen5GetItem(item,quantity=1)
itemname=PBItems.getName(item)
pocket=pbGetPocket(item)
if $PokemonBag.pbStoreItem(item,quantity) # If item can be picked up
case $ItemData[item][ITEMPOCKET]
when 5
pbSEPlay('Basisitem',100,100)
@bg=Sprite.new
@bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/ReceiveItem1")
@bg.x=([email protected])/2
@bg.y=([email protected])/4
@bg.opacity=200
@item=Sprite.new
@item.bitmap=BitmapCache.load_bitmap(sprintf("Graphics/Icons/item%03d.png",$ItemData[item][0]))
@item.x=Graphics.width/[email protected]
@item.y=Graphics.height/[email protected]
@item.zoom_x=2
@item.zoom_y=2
2.times do
5.times do
@item.x+=1
pbWait(3)
end
10.times do
@item.x-=1
pbWait(3)
end
5.times do
@item.x+=1
pbWait(3)
end
end
pbWait(3)
@item.dispose
@bg.dispose
Kernel.pbMessage(_INTL("{1} erhält <c3=4f7cc6,354a6d>{2}</c3>!",$Trainer.name,itemname))
Kernel.pbMessage(_INTL("{1} verstaut das Item {2} in der <c3=4f7cc6,354a6d>BASIS-ITEMS</c3>-Tasche.",$Trainer.name,itemname))
when 4
pbSEPlay('Item',100,100)
Kernel.pbMessage(_INTL("{1} erhält <c3=4f7cc6,354a6d>{2}</c3>!",$Trainer.name,itemname))
Kernel.pbMessage(_INTL("{1} verstaut das Item {2} in der <c3=4f7cc6,354a6d>BEEREN</c3>-Tasche.",$Trainer.name,itemname))
when 3
pbSEPlay('Item',100,100)
Kernel.pbMessage(_INTL("{1} erhält <c3=4f7cc6,354a6d>{2}</c3>!",$Trainer.name,itemname))
Kernel.pbMessage(_INTL("{1} verstaut das Item {2} in der <c3=4f7cc6,354a6d>Techn. Maschinen</c3>-Tasche.",$Trainer.name,itemname))
when 2
pbSEPlay('Item',100,100)
Kernel.pbMessage(_INTL("{1} erhält <c3=4f7cc6,354a6d>{2}</c3>!",$Trainer.name,itemname))
Kernel.pbMessage(_INTL("{1} verstaut das Item {2} in der <c3=4f7cc6,354a6d>MEDIZIN</c3>-Tasche.",$Trainer.name,itemname))
when 1
pbSEPlay('Item',100,100)
Kernel.pbMessage(_INTL("{1} erhält <c3=4f7cc6,354a6d>{2}</c3>!",$Trainer.name,itemname))
Kernel.pbMessage(_INTL("{1} verstaut das Item {2} in der <c3=4f7cc6,354a6d>ITEMS</c3>-Tasche.",$Trainer.name,itemname))
end
return true
else
return false
end
end
but, because of this:
Code:
@bg=Sprite.new
@bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/ReceiveItem1")
@bg.x=([email protected])/2
@bg.y=([email protected])/4
@bg.opacity=200
@item=Sprite.new
@item.bitmap=BitmapCache.load_bitmap(sprintf("Graphics/Icons/item%03d.png",$ItemData[item][0]))
@item.x=Graphics.width/[email protected]
@item.y=Graphics.height/[email protected]
@item.zoom_x=2
@item.zoom_y=2
2.times do
5.times do
@item.x+=1
pbWait(3)
end
10.times do
@item.x-=1
pbWait(3)
end
5.times do
@item.x+=1
pbWait(3)
end
end
pbWait(3)
@item.dispose
@bg.dispose
I can't save anymore. It the mistake: Save failed....
Without this section the script is okay ...