IsabelaFernandez Posted December 10, 2023 Posted December 10, 2023 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; } Quote
0 Winterfox Posted December 11, 2023 Posted December 11, 2023 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; } 1 Quote
0 Winterfox Posted December 10, 2023 Posted December 10, 2023 (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 December 11, 2023 by Winterfox 1 Quote
0 IsabelaFernandez Posted December 11, 2023 Author Posted December 11, 2023 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 : } Quote
Question
IsabelaFernandez
Hi friends. I would like to add a global message for everyone to see which item the player received from this script
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.