Yonko Posted July 1, 2014 Group: Members Topic Count: 166 Topics Per Day: 0.03 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Share Posted July 1, 2014 Hi i would like to request a script on the map like thislet say on prt_fild01 after every 30 seconds a @effect of lightning bolt will shown on randomly on the map and if hits the player the player will die thanks! Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 3, 2014 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 3, 2014 hmm maybe using OnTouch is a bit buggy well, try prt_fild01,1,1,0 script #dummy_light 111,{ end; OnAttach: addrid 1; getmapxy .@map_npc$,.@x_npc,.@y_npc,1; getmapxy .@map$,.@x,.@y,0; if ( distance( .@x_npc,.@y_npc,.@x,.@y ) < 2 ) unitkill getcharid(3); end; } - script main_bolt -1,{ OnInit: while(1) { do { .@x = rand(1,400); .@y = rand(1,400); } while( !checkcell( "prt_fild01",.@x,.@y,cell_chkpass ) ); movenpc "#dummy_light",.@x,.@y; enablenpc "#dummy_light"; specialeffect EF_LIGHTBOLT,AREA,"#dummy_light";// seems doesn't work with sprite -1 disablenpc "#dummy_light"; if ( getareausers( "prt_fild01",(.@x-1),(.@y-1),(.@x+1),(.@y+1) ) > 0 ) donpcevent "#dummy_light::OnAttach"; sleep 30000; } } 1 Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 3, 2014 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 3, 2014 try prt_fild01,1,1,0 script #dummy 111,2,2,{ end; OnTouch: unitkill getcharid(3); } - script main_bolt -1,{ OnInit: while(1) { do { .@x = rand(400); .@y = rand(400); } while( !checkcell( "prt_fild01",.@x,.@y,cell_chkpass ) ); movenpc "#dummy",.@x,.@y; enablenpc "#dummy"; specialeffect EF_LIGHTBOLT,AREA,"#dummy"; sleep 1000; disablenpc "#dummy"; sleep 30000; } } 1 Quote Link to comment Share on other sites More sharing options...
Yonko Posted July 3, 2014 Group: Members Topic Count: 166 Topics Per Day: 0.03 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Author Share Posted July 3, 2014 (edited) try prt_fild01,1,1,0 script #dummy 111,2,2,{ end; OnTouch: unitkill getcharid(3); } - script main_bolt -1,{ OnInit: while(1) { do { .@x = rand(400); .@y = rand(400); } while( !checkcell( "prt_fild01",.@x,.@y,cell_chkpass ) ); movenpc "#dummy",.@x,.@y; enablenpc "#dummy"; specialeffect EF_LIGHTBOLT,AREA,"#dummy"; sleep 1000; disablenpc "#dummy"; sleep 30000; } } Thanks Capuche! Works 100% ! EDIT: there's a problem when i get killed the lightning still fires up to the ground up to 20x after that i use @raise then the lightning strike stops. Edited July 3, 2014 by Xii Quote Link to comment Share on other sites More sharing options...
Yonko Posted July 3, 2014 Group: Members Topic Count: 166 Topics Per Day: 0.03 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Author Share Posted July 3, 2014 (edited) Seems the script works fine but it still stop sending lightning bolts and i pressumed an error occurs see the image for preferences Edited July 3, 2014 by Xii Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 3, 2014 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 3, 2014 strange it throws an infinity loop, there is a lot of free cell add a freeloop(1); OnInit: freeloop(1); while(1) { Quote Link to comment Share on other sites More sharing options...
Yonko Posted July 3, 2014 Group: Members Topic Count: 166 Topics Per Day: 0.03 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Author Share Posted July 3, 2014 okay lemme try again, thank you for your patience =) Quote Link to comment Share on other sites More sharing options...
Question
Yonko
Hi i would like to request a script on the map like this
let say on prt_fild01 after every 30 seconds a @effect of lightning bolt will shown on randomly on the map and if hits the player the player will die thanks!
Link to comment
Share on other sites
6 answers to this question
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.