Help me on this Script

Luffy

New member
Messages
303
Points
0
Location
#DDos
Emulator
i setup this script but it seems nothing happen if i loaded it on server.

Code:
-	script	GMCONTROL	-1,{OnInit:set $gmcontrol,90;end;}-	script	bmevent	-1,{OnWhisperGlobal:if(getgmlevel() >= $gmcontrol) {mes "^3399FF[BringMeEvent]^000000";	mes "Hello GameMaster!";mes "What do you want to do?";switch(select("Start Event:Stop Event:Nothing")){	case 1: 	{		next;		mes "^3399FF[BringMeEvent]^000000";		mes "Please confirm by typing START."; 		input .@confirm$;          		if (.@confirm$ == "START") 		{			donpcevent "Announcer2::OnGMStart"; 			close;		}		mes "Confirmation failed";		close;		break;	}	case 2:	{		next;		mes "^3399FF[BringMeEvent]^000000";		mes "Please confirm by typing STOP."; 		input .@confirm$;          		if (.@confirm$ == "STOP") 		{			donpcevent "Announcer2::OnGMStop";			close;		}		mes "Confirmation failed";		close;		break;			}						case 3:	{		next; mes "^3399FF[BringMeEvent]^000000";		mes "Good bye"; 		close;	}}}}//====================ANNOUNCER======================-	script	Announcer2	-1,{OnGMStart:	announce "(BringMeEvent) : A Gamemaster started a Bring Me Event now.",0;	sleep 3000;	announce "(BringMeEvent) : If you want to join, come at the middle of Prontera",0;	enablenpc "BringMeEvent";	sleep 2000;	announce "(BringMeEvent) : Prize: will be TCG and 1x Elite Siege Supply Box",0;	sleep 2000;	announce "(BringMeEvent) : Hurry Now!.",0;  	sleep 2000;	announce "(BringMeEvent) : GAME STARTED.",0;	end;	OnGMStop:	announce "A Gamemaster has stopped the Bring Me Event",0;	disablenpc "BringMeEvent";	end;}prontera,150,150,0	script	BringMeEvent	100,{	if (countitem(.@item) < .@amount) {		mes "You don't have my requirements";		close;	}	delitem .@item, .@amount;	getitem .p, .a;	announce "Yayks! " + strcharinfo(0) + " won the event",0;	disablenpc "BringMeEvent";	end;				.@i = rand( getarraysize(@BringMeItems) );		.@item = @BringMeItems[ .@i ];		.@amount = rand(1,100);		announce "Bring me " + .amount + "x " + getitemname( .item ),0;		enablenpc "BringMeEvent";		end;	OnInit:		setarray @BringMeItems[0],501,7227,4001,7005,909,512,714;		set @arraysize,getarraysize(@BringMeItems);		.p = 7227;		.a = 5; 		disablenpc "BringMeEvent";		end;		}
 
Last edited by a moderator:
Try this, to start type '@startbme', to stop type '@stopbme'

Code:
//====================ANNOUNCER======================-	script	Announcer2	-1,{OnGMStart:	announce "(BringMeEvent) : A Gamemaster started a Bring Me Event now.",0;	sleep 3000;	announce "(BringMeEvent) : If you want to join, come at the middle of Prontera",0;	enablenpc "BringMeEvent";	sleep 2000;	announce "(BringMeEvent) : Prize: will be TCG and 1x Elite Siege Supply Box",0;	sleep 2000;	announce "(BringMeEvent) : Hurry Now!.",0;  	sleep 2000;	announce "(BringMeEvent) : GAME STARTED.",0;	end;	OnGMStop:	announce "A Gamemaster has stopped the Bring Me Event",0;	disablenpc "BringMeEvent";	end;OnInit:	bindatcmd "startbme",strnpcinfo(3)+"::OnGMStart",90,99;	bindatcmd "stopbme",strnpcinfo(3)+"::OnGMStop",90,99;	end;}prontera,150,150,0	script	BringMeEvent	100,{	if (countitem(.item) < .amount) {		mes "You don't have my requirements";		close;	}	delitem .item, .amount;	getitem .p, .a;	announce "Yayks! " + strcharinfo(0) + " won the event",0;	disablenpc "BringMeEvent";	end;	.@i = rand( getarraysize(.BringMeItems) );	.item = .BringMeItems[.@i];	.amount = rand(1,100);	announce "Bring me " +.amount+ "x " +getitemname(.item ),0;	enablenpc "BringMeEvent";	end;OnInit:	setarray .BringMeItems[0],501,7227,4001,7005,909,512,714;	.arraysize, getarraysize(.BringMeItems);	.p = 7227;	.a = 5; 	disablenpc "BringMeEvent";	end;}
 
got an error on --> .arraysize
and also this

bme10.jpg


 
Last edited by a moderator:
@BringMeItems[0]

@arraysize

if you logout two variable above will be remove. try to use: 

.BringMeItems[0]

.arraysize

and 

.arraysize, getarraysize(.BringMeItems);
to

Code:
set .arraysize, getarraysize(.BringMeItems);
 
Last edited by a moderator:
@BringMeItems[0]

@arraysize

if you logout two variable above will be remove. try to use:

.BringMeItems[0]

.arraysize

and

.arraysize, getarraysize(.BringMeItems);to
Code:
set .arraysize, getarraysize(.BringMeItems);
still got this error when clicking the NPC
bme10.jpg


 
Last edited by a moderator:
How do you want it to work, everyone gets the same item, or each player gets his own?

Main problem lies here:

if (countitem(.@item) < .@amount) { mes "You don't have my requirements"; close; } delitem .@item, .@amount; getitem .p, .a; announce "Yayks! " + strcharinfo(0) + " won the event",0; disablenpc "BringMeEvent"; end;
Both .@item and .@amount are not set within the script before being called here, so they are 0. That's why you're getting errors. I'd fix it, but I'm a bit unsure on how you want this event to run.

ETA: Also, a side question, isn't it a bit strange to ask for item 7227 in the amount of 1~100, and reward with 5 of same item? Sounds like a fraud to me ._.

 
Last edited by a moderator:
How do you want it to work, everyone gets the same item, or each player gets his own?

Main problem lies here:

if (countitem(.@item) < .@amount) { mes "You don't have my requirements"; close; } delitem .@item, .@amount; getitem .p, .a; announce "Yayks! " + strcharinfo(0) + " won the event",0; disablenpc "BringMeEvent"; end;Both .@item and .@amount are not set within the script before being called here, so they are 0. That's why you're getting errors. I'd fix it, but I'm a bit unsure on how you want this event to run.
ETA: Also, a side question, isn't it a bit strange to ask for item 7227 in the amount of 1~100, and reward with 5 of same item? Sounds like a fraud to me ._.
the thing is i want it to be a usual Bring me Event, but you can set the items to be bring brought on the npc with random amount,and also im trying to make it 5 to 10 rounds before the event end.

and the result is this, im pretty mess up on this. XD haha im really noob on the arrays or and something.

still learning , hope you understand XD

Sorry on the 7227 its just a testing purposes. will be remove it work.

 
Last edited by a moderator:
got an error on --> .arraysize

and also this

bme10.jpg
1. .arraysize var is not used so i remove it

2. as @@Garr said, so i make it set when npc got started

Both .@item and .@amount are not set within the script before being called here, so they are 0. That's why you're getting errors.
3. Added rounds setting as requested

Code:
//====================ANNOUNCER======================-    script    Announcer2    -1,{OnGMStart:    announce "(BringMeEvent) : A Gamemaster started a Bring Me Event now.",0;    sleep 3000;    announce "(BringMeEvent) : If you want to join, come at the middle of Prontera",0;        .@i = rand( getarraysize(.BringMeItems) );    set getvariableofnpc(.item,"BringMeEvent"), .BringMeItems[.@i];    set getvariableofnpc(.amount,"BringMeEvent"), rand(1,100);    set getvariableofnpc(.Round,"BringMeEvent"), 1;        enablenpc "BringMeEvent";    announce "(BringMeEvent) : Bring me "+getvariableofnpc(.amount,"BringMeEvent")+"x "+getvariableofnpc(.item,"BringMeEvent"),0;    sleep 2000;    announce "(BringMeEvent) : Prize: will be TCG and 1x Elite Siege Supply Box",0;    sleep 2000;    announce "(BringMeEvent) : Hurry Now!.",0;      sleep 2000;    announce "(BringMeEvent) : GAME STARTED.",0;    end;OnGMStop:    announce "A Gamemaster has stopped the Bring Me Event",0;    disablenpc "BringMeEvent";    end;OnNextRound:    .@i = rand( getarraysize(.BringMeItems) );    set getvariableofnpc(.item,"BringMeEvent"), .BringMeItems[.@i];    set getvariableofnpc(.amount,"BringMeEvent"), rand(1,100);    announce "(BringMeEvent) : Bring me "+getvariableofnpc(.amount,"BringMeEvent")+"x "+getvariableofnpc(.item,"BringMeEvent"),0;    sleep 2000;    announce "(BringMeEvent) : Prize: will be TCG and 1x Elite Siege Supply Box",0;    sleep 2000;    announce "(BringMeEvent) : Hurry Now!.",0;    end;OnInit:    setarray .BringMeItems[0],501,7227,4001,7005,909,512,714;    bindatcmd "startbme",strnpcinfo(3)+"::OnGMStart",90,99;    bindatcmd "stopbme",strnpcinfo(3)+"::OnGMStop",90,99;    end;}prontera,150,150,0    script    BringMeEvent    100,{    if (countitem(.item) < .amount) {        mes "You don't have my requirements";        close;    }    delitem .item, .amount;    getitem .p, .a;    announce "Yayks! "+strcharinfo(0)+" won the "+.Round+" round event",0;    .Round++;    if (.Round > .Rounds) disablenpc "BringMeEvent";    else        donpcevent "Announcer2::OnNextRound";    end;OnInit:    .Rounds = 10; // Set how many round you want here    .p = 7227;    .a = 5;    disablenpc "BringMeEvent";    end;}
 
Last edited by a moderator:
got an error on --> .arraysize

and also this

bme10.jpg
 1. .arraysize var is not used so i remove it

2. ass @@Garr said, so i make it set when npc got started

Both .@item and .@amount are not set within the script before being called here, so they are 0. That's why you're getting errors.
 3. Added rounds setting as requested
Wow Thank you, i didnt know that getvariableofnpc hehe thumbs up, BTW one questionhow can i announce it in Words not in ID number of the item.

" + getitemname( .item )+" doesnt work it shows Null.

 
try change this..

getvariableofnpc(.item,"BringMeEvent")
into this..

Code:
getitemname(getvariableofnpc(.item,"BringMeEvent"))
 
Back
Top