The Dink Network

Reply to Re: How do i make it so i can pick up gold

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 10th 2005, 10:40 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
You mean the script lgold? You can just look into the source folder.
This is an example of a script you can use (just lgold with some modifications):

void main( )
{
sp_pseq(¤t_sprite, 178);
sp_frame(¤t_sprite, 4);
sp_touch_damage(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);

&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
&save_y += random(5,1);
int &startframe = random(5,1);
int &spark = create_sprite(&save_x, &save_y, 15, 165, 1);
sp_seq(&spark, 165);
sp_nohit(&spark, 1);
sp_frame(&spark, &startframe);
sp_brain_parm(&spark, ¤t_sprite);

}

void touch( void )
{
&gold += 1000;
say("WOW! I just found 1000 gold!",1);
sp_brain_parm(¤t_sprite, 10);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}

You should only use this one with monsters
if you want to be able to place it in the editor paste these lines into the script: (directly after sp_timing(&current_sprite,0)

int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);