Jump to content
  • 0

Question

Posted

Hi friends. I would like to add a global message for everyone to see which item the player received from this script

Spoiler

function    script    randombox    {
setarray .BoxItems[0],501,505,522;


set .Random, rand( getarraysize( .BoxItems ) );
getitem .BoxItems[ .Random ], 1;
end;
}

 

3 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, IsabelaFernandez said:
  Hide contents


script error on npc/custom/albummvp.txt line 7
    parse_simpleexpr: unexpected character
     2 :        setarray(.@box_items, 501, 505, 522);
     3 :
     4 :        .@item = .@box_items[rand(getarraysize(.@box_items))];
     5 :
     6 :        getitem(.@item, 1);
*    7 :        announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!", ')';
     8 :
     9 : return;
    10 : }
 

 

function	script	randombox	{
	setarray(.@box_items, 501, 505, 522);

	.@item = .@box_items[rand(getarraysize(.@box_items))];

	getitem(.@item, 1);
	announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!");

	return;
}

 

  • Upvote 1
  • 0
Posted (edited)
function	script	randombox	{
	setarray(.@box_items, 501, 505, 522);

	.@item = .@box_items[rand(getarraysize(.@box_items))];

	getitem(.@item, 1);
	announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!");

	return;
}

 

Edited by Winterfox
  • Upvote 1
  • 0
Posted
22 hours ago, Winterfox said:
function	script	randombox	{
	setarray(.@box_items, 501, 505, 522);

	.@item = .@box_items[rand(getarraysize(.@box_items))];

	getitem(.@item, 1);
	announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!", );

	return;
}

 

Spoiler


script error on npc/custom/albummvp.txt line 7
    parse_simpleexpr: unexpected character
     2 :        setarray(.@box_items, 501, 505, 522);
     3 :
     4 :        .@item = .@box_items[rand(getarraysize(.@box_items))];
     5 :
     6 :        getitem(.@item, 1);
*    7 :        announce(strcharinfo(0) + " got a " + getitemname(.@item) + "!", ')';
     8 :
     9 : return;
    10 : }
 

 

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...