Jump to content
  • 0
Luffy

Help me on this Script

Question

i setup this script but it seems nothing happen if i loaded it on server.

 

-	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;		}

 

 

Edited by Luffy

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

try change this..

getvariableofnpc(.item,"BringMeEvent")

into this..

getitemname(getvariableofnpc(.item,"BringMeEvent"))

Share this post


Link to post
Share on other sites
  • 0

Try this, to start type '@startbme', to stop type '@stopbme'

//====================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;}

Share this post


Link to post
Share on other sites
  • 0

@BringMeItems[0]

@arraysize

 

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

.BringMeItems[0]

.arraysize

 

and 

 

.arraysize, getarraysize(.BringMeItems);

to

 

set .arraysize, getarraysize(.BringMeItems);
Edited by Hirist

Share this post


Link to post
Share on other sites
  • 0

 

@BringMeItems[0]

@arraysize

 

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

.BringMeItems[0]

.arraysize

 

and

.arraysize, getarraysize(.BringMeItems);
to

set .arraysize, getarraysize(.BringMeItems);

 

 

still got this error when clicking the NPC

bme10.jpg

Edited by Luffy

Share this post


Link to post
Share on other sites
  • 0

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

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

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.

Edited by Luffy

Share this post


Link to post
Share on other sites
  • 0

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

//====================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;}
Edited by Litro

Share this post


Link to post
Share on other sites
  • 0

 

 

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 question

how can i announce it in Words not in ID number of the item.

 

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

Share this post


Link to post
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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.