Pysk Posted January 30, 2014 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 234 Reputation: 8 Joined: 01/19/12 Last Seen: April 20, 2020 Share Posted January 30, 2014 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. Quote Link to comment Share on other sites More sharing options...
Netsrot Posted January 31, 2014 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 77 Reputation: 5 Joined: 12/05/12 Last Seen: May 28, 2016 Share Posted January 31, 2014 (edited) 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 January 31, 2014 by Netsrot Quote Link to comment Share on other sites More sharing options...
Jey Posted January 31, 2014 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share Posted January 31, 2014 ^ 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 ^^ Quote Link to comment Share on other sites More sharing options...
Netsrot Posted January 31, 2014 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 77 Reputation: 5 Joined: 12/05/12 Last Seen: May 28, 2016 Share Posted January 31, 2014 @Jey: Jupp und ein break am Ende eines case ist auch nützlich Mfg Nets Quote Link to comment Share on other sites More sharing options...
Pysk Posted January 31, 2014 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 234 Reputation: 8 Joined: 01/19/12 Last Seen: April 20, 2020 Author Share Posted January 31, 2014 (edited) 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 January 31, 2014 by Pysk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.