Jump to content
  • 0

Need advice with my script


Question

Posted (edited)

I have a portal NPC, and I got a problem.

prontera,72,226,1 script portal::portal1 45,2,2,{
set @Prize,rand(3);
if (@Prize==1) goto: sidji;
if (@Prize==2) goto: loeroe;
if (@Prize==3) goto: teloe;
sidji:
getitem 606,10;
atcommand "@load";
close;
loeroe:
getitem 608,20;
atcommand "@load";
close;
teloe:
getitem 607,20;
atcommand "@load";
close;
}

if player enter that portal, get random price.

but, it doesn't work...

thank's for advance:)

Edited by DJFUNK

8 answers to this question

Recommended Posts

Posted

prontera,72,226,1 script portal::portal1 45,2,2,{
set @Prize,rand(1,3);
if (@Prize==1) goto sidji;
if (@Prize==2) goto loeroe;
if (@Prize==3) goto teloe;
sidji:
getitem 606,10;
atcommand "@load";
close;
loeroe:
getitem 608,20;
atcommand "@load";
close;
teloe:
getitem 607,20;
atcommand "@load";
close;
}

Posted
prontera,156,172,1	script	portal1	45,2,2,{
switch ( rand(3) ) {
	default: getitem 606,10; break;
	case 1: getitem 608,20; break;
	case 2: getitem 607,20;
}
warp "Save", 0,0;
end;
}

no need OnTouch, if the npc already has 2,2 ... defined the radius, it automatically trigger as it is having an OnTouch

Posted (edited)

prontera,156,172,1    script    portal1    45,2,2,{
   switch ( rand(3) ) {
       default: getitem 606,10; break;
       case 1: getitem 608,20; break;
       case 2: getitem 607,20;
   }
   warp "Save", 0,0;
   end;
}

no need OnTouch, if the npc already has 2,2 ... defined the radius, it automatically trigger as it is having an OnTouch

I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_x

I don't think that it is the point of a portal anw, just for semantic reasons.

So, you can just add this to Annie's awesome script:

prontera,156,172,1    script    portal1    45,2,2,{
   end; // Do nothing when the player clicks
   OnTouch: // Execute script when the player approaches
   switch ( rand(3) ) {
       default: getitem 606,10; break;
       case 1: getitem 608,20; break;
       case 2: getitem 607,20;
   }
   warp "Save", 0,0;
   end;
}

@edit: fixed typo at my bbcode

Edited by Schrwaizer
Posted
I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_x
really ? o.o

in my test server, if you click on warp portal npc ID 45, you will walk to the portal instead of triggering it from clicking

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...