RPG Maker Forums

After Eval>


if (user.isEnemy(1)) {


var successRate = 0.5;


if (Math.random(1) < successRate) {


var items = [1];


var total = $gameParty.items(1).length;


for (var i = 0; i < total; ++i) {


var item = $gameParty.items(1);


if (item.itypeId !== 2) items.push(item);


}


var random = Math.floor(Math.random() * items.length);


var item = items[random];


$gameParty.loseItem(item, 1);


var text = user.name(1) + ' stole ' + item.name + ' from the party!';


SoundManager.playEquip(1);


} else {


var text = user.name(1) + ' failed to steal an item!';


SoundManager.playBuzzer(1);


}


var window = SceneManager._scene._logWindow;


window._lines.push(text + '<CENTER>');


window.refresh(1);


}


</After Eval>
Okay, I must be doing something wrong here. I just tried to do the Enemy Thieves thing with my Steal Item (partially to see if it was successfully working and partially because I'm trying to still do the "Enemies Steal Weapons thing") skill. At first I copy pasted the code exactly as you put it in the video. That got me this. I tried again, adding in numbers to any paratheses I found. Same result when the Slime went up to perform the Pilfer action.


 


For what it's worth, here's the code for the regular action:

<Steal Item>


 


<setup action>


display action


immortal: targets, true


</setup action>


 


<target action>


move user: targets, front, 20


motion standby: user


wait for movement


face user: target


action animation: target


move user: targets, base, 10


motion thrust: user, no weapon


wait: 15


action effect


jump user: 50, 10


move user: targets, front, 10


face user: forward


wait: 60


</target action>
Does anybody know what I'm doing wrong?


Screenshot 2016-04-04 01.27.02.png






 

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top