Hi there, i have a script where i summon a random monster, based on an array, and announce who killed it and which monster it was. It's working, it does summon the random monster, but when it announces the killed monster, the "getmonsterinfo" function is returning "null" (O Mini-Chefe null foi MORTO pelo guerreiro [Player Name])
.mvp_mapa$ is the string "pay_dun03"
.mvp_quant is an integer to set the number of monsters.
set.mvp_mapa$,"pay_dun03";set.mvp_quant,1;
.@idsalamvpmvp is an array of integers with some monters' id:
Here's the part that summons and announces when the monster gets killed:
monster .mvp_mapa$,0,0,getmonsterinfo(.@idsalamvpmvp[.idsalamvp],0),.@idsalamvpmvp[.idsalamvp],.mvp_quant,"salamb::OnDeadMVP";
end;OnDeadMVP:
areaannounce .mvp_mapa$,20,20,280,280,"O Mini-Chefe "+getmonsterinfo(.@idsalamvpmvp[.idsalamvp],0)+" foi MORTO pel"+(Sex?"o":"a")+" guerreir"+(Sex?"o":"a")+" "+strcharinfo(0)+"!",bc_map;
ps: I don't see why it wouldn't work with local variables but it may be relevant to mention that i have a second script just like this one, using global variables and working. I had to use local variables so i have two independent scripts.
I tried to find what could be wrong with the script but i didn't manage to fix it.
Question
darkpatow
Hi there, i have a script where i summon a random monster, based on an array, and announce who killed it and which monster it was. It's working, it does summon the random monster, but when it announces the killed monster, the "getmonsterinfo" function is returning "null" (O Mini-Chefe null foi MORTO pelo guerreiro [Player Name])
.mvp_mapa$ is the string "pay_dun03"
.mvp_quant is an integer to set the number of monsters.
.@idsalamvpmvp is an array of integers with some monters' id:
.idsalamvp is a random integer limited to the array size.
Here's the part that summons and announces when the monster gets killed:
ps: I don't see why it wouldn't work with local variables but it may be relevant to mention that i have a second script just like this one, using global variables and working. I had to use local variables so i have two independent scripts.
I tried to find what could be wrong with the script but i didn't manage to fix it.
Any help will be appreciated.
Edited by darkpatowLink to comment
Share on other sites
1 answer 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.