Jump to content

NPC funktioniert nur wann er will?


Pysk

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  234
  • Reputation:   8
  • Joined:  01/19/12
  • Last Seen:  

Hallo.

 

Ich wollte mir einen NPC mit 6 Random Warps machen. Dieser Funktioniert auch, aber nicht immer.

 

Manschmal warpt er und manschmal bleibt er einfach stehen. Der Server gibt aber keinen Fehler aus.

 

    next;
    mes "^ff0000[Warper]^000000";
    mes "Okay, dann bringe ich dich jetzt dahin.";
    switch(rand(5)) {

case 1:    
    savepoint "eot_1",52,2;
    warp "eot_1",52,2;  end;
case 2:    
    savepoint "eot_2",52,2;
    warp "eot_2",52,2;  end;
case 3:    
    savepoint "eot_3",52,2;
    warp "eot_3",52,2;  end;
case 4:    
    savepoint "eot_4",52,2;
    warp "eot_4",52,2;  end;
case 5:    
    savepoint "eot_5",52,2;
    warp "eot_5",52,2;  end;
case 6:    
    savepoint "eot_6",52,2;
    warp "eot_6",52,2;  end;
}}

 

Das ist der Part davon und eigentlich sollte das so laufen. Anfangs hatte ich das so als Random Warp Portal das machte auch keine Problme nur im NPC kommt das vor.

 

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   5
  • Joined:  12/05/12
  • Last Seen:  

Moin Moin ^^

 

Dein switch(rand(5)) gibt an und zu mal ne NULL raus und Du hast keinen case 0 im Script  :)

 

switch(rand(1,6)) sollte das problem beheben. Bin mir mit der Syntax nicht 100% sicher, guck am besten nochmal in scriptcommands.txt nach.

 

Mfg

 

Netsrot  :)

Edited by Netsrot
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  249
  • Reputation:   72
  • Joined:  10/20/12
  • Last Seen:  

^ Scheint korrekt zu sein.

*rand(<number>{,<number>});

This function returns a number ...
(if you specify one) ... randomly positioned between 0 and the number you specify -1.
(if you specify two) ... randomly positioned between the two numbers you specify.

 

Ansonsten ist es manchmal auch sinnvoll sowas wie "default: close;" zu machen ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   5
  • Joined:  12/05/12
  • Last Seen:  

@Jey: Jupp  :) und ein break am Ende eines case ist auch nützlich  :)

 

Mfg

 

Nets :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  234
  • Reputation:   8
  • Joined:  01/19/12
  • Last Seen:  

Danke ihr 2 hat so geklapptt. Beim Warp Portal gings halt so.

 

Ich habe es jetzt mit switch(rand(5)) gemacht. Wobei ich überlegt habe obs nicht auch gegangen wäre case 0, statt 1 zu machen.

 

Ist aber nun auch egal.

Edited by Pysk
Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   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.

×
×
  • Create New...