Kakaroto Posted May 5, 2016 Group: Members Topic Count: 99 Topics Per Day: 0.02 Content Count: 638 Reputation: 95 Joined: 05/11/12 Last Seen: 4 hours ago Share Posted May 5, 2016 (edited) Hello. I'm trying to create a custom instance, but can not make a npc appear when the given time, and not to show a viewpoint on the mini map, the following error on map_server: Script: 1@glast,1,1,0 script #snfescape CLEAR_NPC,{ end; OnStart: initnpctimer; end; OnTimer1500: donpcevent instance_npcname("#snfBGM")+"::OnEscape"; .@map$ = instance_mapname("1@glast"); viewpoint 1,351,271,1,0x00FF00; for(.@i = 1; .@i <= 5; .@i++) { My other problem is this, I can not instantiate this npc: 1@glast,176,179,4 script Tesouro#snf1 4_TREASURE_BOX,{ .@map$ = instance_mapname("1@glast"); setarray .@gain,912,719,723,730,730,730,7228,7229,7229,6803,15121,8523; setarray .@rate,900,800,800,500,300,200, 300, 500, 200, 100, 10, 10; getmapxy(.@map$,.@x,.@y,1,instance_npcname(strnpcinfo(0))); specialeffect 10; hideonnpc instance_npcname(strnpcinfo(0)); for(.@i = 0; .@i<getarraysize(.@gain); .@i++) { if(rand(1000) < .@rate[.@i]) makeitem .@gain[.@i],1,.@map$,.@x+rand(3)-1,.@y+rand(3)-1; } end; OnInstanceInit: disablenpc instance_npcname(strnpcinfo(0)); end; } 1@glast,62,279,0 duplicate(Tesouro#snf1) Tesouro#snf2 4_TREASURE_BOX 1@glast,200,135,4 duplicate(Tesouro#snf1) Tesouro#snf3 4_TREASURE_BOX 1@glast,97,38,4 duplicate(Tesouro#snf1) Tesouro#snf4 4_TREASURE_BOX 1@glast,267,351,0 duplicate(Tesouro#snf1) Tesouro#snf5 4_TREASURE_BOX In the same npc top that has the viewpoint, it should enable the treasures, but they do not activate: 1@glast,1,1,0 script #snfescape CLEAR_NPC,{ end; OnStart: initnpctimer; end; OnTimer1500: donpcevent instance_npcname("#snfBGM")+"::OnEscape"; .@map$ = instance_mapname("1@glast"); viewpoint 1,351,271,1,0x00FF00; for(.@i = 1; .@i <= 5; .@i++) { enablenpc instance_npcname("Tesouro#snf"+.@i); Can someone help me? Edited May 5, 2016 by Kakaroto Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted May 7, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted May 7, 2016 use attachnpctimer before you use the initnpctimer 1 Quote Link to comment Share on other sites More sharing options...
0 Promise Posted May 5, 2016 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 386 Reputation: 38 Joined: 04/28/13 Last Seen: March 22, 2024 Share Posted May 5, 2016 (edited) 1@glast,1,1,0 script #snfescape CLEAR_NPC,{ end; // <--------- Wtf? OnStart: initnpctimer; end; OnTimer1500: donpcevent instance_npcname("#snfBGM")+"::OnEscape"; .@map$ = instance_mapname("1@glast"); viewpoint 1,351,271,1,0x00FF00; for(.@i = 1; .@i <= 5; .@i++) { enablenpc instance_npcname("Tesouro#snf"+.@i); btw, check the x,y map and try by changing #snfBGM for snfBGM - #snfescape for snfescape Edited May 5, 2016 by Promise Quote Link to comment Share on other sites More sharing options...
0 Kakaroto Posted May 5, 2016 Group: Members Topic Count: 99 Topics Per Day: 0.02 Content Count: 638 Reputation: 95 Joined: 05/11/12 Last Seen: 4 hours ago Author Share Posted May 5, 2016 1@glast,1,1,0 script #snfescape CLEAR_NPC,{ end; // <--------- Wtf? OnStart: initnpctimer; end; OnTimer1500: donpcevent instance_npcname("#snfBGM")+"::OnEscape"; .@map$ = instance_mapname("1@glast"); viewpoint 1,351,271,1,0x00FF00; for(.@i = 1; .@i <= 5; .@i++) { enablenpc instance_npcname("Tesouro#snf"+.@i); btw, check the x,y map and try by changing #snfBGM for snfBGM - #snfescape for snfescape Did not work '-' Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted May 6, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted May 6, 2016 you need to attach the timer to a player. viewpoint only work if there are any player attached to current executing script. Quote Link to comment Share on other sites More sharing options...
0 Kakaroto Posted May 7, 2016 Group: Members Topic Count: 99 Topics Per Day: 0.02 Content Count: 638 Reputation: 95 Joined: 05/11/12 Last Seen: 4 hours ago Author Share Posted May 7, 2016 (edited) you need to attach the timer to a player. viewpoint only work if there are any player attached to current executing script. thnx, I'll try. you need to attach the timer to a player. viewpoint only work if there are any player attached to current executing script. arg ... how do it '-' Edited May 6, 2016 by Kakaroto Quote Link to comment Share on other sites More sharing options...
0 Kakaroto Posted May 7, 2016 Group: Members Topic Count: 99 Topics Per Day: 0.02 Content Count: 638 Reputation: 95 Joined: 05/11/12 Last Seen: 4 hours ago Author Share Posted May 7, 2016 use attachnpctimer before you use the initnpctimer OnStart: attachnpctimer getcharid(3); initnpctimer; end; like this? Quote Link to comment Share on other sites More sharing options...
Question
Kakaroto
Hello.
I'm trying to create a custom instance, but can not make a npc appear when the given time, and not to show a viewpoint on the mini map, the following error on map_server:
Script:
My other problem is this, I can not instantiate this npc:
In the same npc top that has the viewpoint, it should enable the treasures, but they do not activate:
Can someone help me?
Edited by KakarotoLink 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.