Ok, I will explain how to use it:
1. Create a global variable in the world map (example: "starcoin");
2. Go to a level and make every star coin to trigger this script when you collect them (Death):
3. Go to the shop and change the script named "Value" with this:
Code: Select all
------------------------------------------CUSTOM SHOP SYSTEM--------------------------------
'By Catskart
'-------------------------------------------------------------------------------------------------------------
'Script : Value.
'This script will set all necesary values and bitmap for the functionment.
'Disable all jumps
sysval(Disablejump)=1
sysval(Disablespinjump)=1
'Set the item in the itembox, we need to use the HUDSET for that.
call HUDSet("initialize", 0, 0, 0, 0, 0, 0, 0, 0, 0)
call HUDSet("bitmap", 1,0,0,1,1,96,280,5001,-1)
'Set the Life and coin value to set the money (1 life=100 coins)
val(Money)=gval(starcoin)
'Goto money will be show, it makes the transition from a number to another one.
val(GotoMoney)=val(Money)
'Set the cursor, his coordonate will be by 32 pixels
call BmpCreate(1, 1, 1, 1, 0, 0, 32, 32, val(cursorX)*16, -7+val(cursorY)*16, 1, 1, 0,0, 0, -1)
do
'Imobilize the player.
char(1).x=char(2).x
char(1).facing=0
'GotoMoney transition
if val(GotoMoney) > val(Money) then
val(GotoMoney)=val(GotoMoney)-1
call tcreate([SOUND]Coin,0)
elseif val(GotoMoney) < val(Money) then
val(GotoMoney)=val(GotoMoney)+1
call tcreate([SOUND]Coin,0)
end if
'Cursor coordonate
Bitmap(1).destx=val(cursorX)*32
Bitmap(1).desty=-7+val(cursorY)*32
'Set the sysval the new value for lives and coins if the player click on "Quit".
if val(Menu)=-1 then
gval(starcoin)=val(Money)
end if
call sleep(1)
loop
Note that you have to change the prices of the items, because you don't wanna pay 10 star coins for a single mushroom do you?
I may be missing something, so tell me if it worked. Hope it helped!
