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.
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(¤t_sprite,0)
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
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(¤t_sprite,0)

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