- if you put "actor" in the scriptbox, youll immediately get an error as that wont be defined. thats why i said "once you have a reference to the actor". you already stored the actor's id into a variable, so $gameActors.actor([$gameVariables.value(21)) would be your reference
- equipItem is a function and is the function youre supposed to use.
- equipItems doesnt return anything. its call wouldnt have any properties. what is actorX supposed to be?
- i told you about the arguments equipItem takes, but i assumed the value of the variable an id for the weapon. Even though you didnt call it, what you did try to call would use the weapon that shares the id as the actor whose id you stored in the variable. if that isnt the case, you need to use another variable or place an id in manually
Ok , here's how i see it :
First as a common event(lets say common event 1) I store the id of the only actor in the party (let's say between 1..20) in variable no22
then secondary, when a chest is activated with the ok button, I roll a random number within 0 and 1 (variable no 23), to determine if its a weapon chest or a spell chest,
and for the third part, I roll the variable no21, so it makes a thing like this :
roll var21 1..0
if var23 = 0
roll Var21 : 1..12
giveActor(var22.value) Weapon(var21.value)
if
roll Var21 : 1..20
giveActor(var22.value) Skill(var21.value)
actor.addSpell.actorX($dataSpells[$gameVariables.value(22)]
same as above, but also
- addSpell isnt a function
- $dataSpells isnt a thing within RPGMaker MV
Where did you get these from?
I haven't read it anywhere, i'm just trying to explain how i see the thing, i'm kinda new to object base coding (js tho)
thanks a lot for your help