Telemetius
Tele*
- 256
- Posts
- 10
- Years
- Italy
- Seen Jan 9, 2022
Hi forum, so I have a question, how can I code an event modifier that checks if the first pkm of my opponent has a specific item?
I know about ".setItem" but what i need is just to check if the pkm already has that item.
Here's what I tried to do:
Any help?
I know about ".setItem" but what i need is just to check if the pkm already has that item.
Here's what I tried to do:
Code:
Events.onTrainerPartyLoad+=proc {|sender,e|
if e[0] # Trainer data should exist to be loaded, but may not exist somehow
trainer=e[0][0] # A PokeBattle_Trainer object of the loaded trainer
items=e[0][1] # An array of the trainer's items they can use
party=e[0][2] # An array of the trainer's Pokémon
if party[0].isConst?(@item,PBItems,:TESTITEM)
party[0].form=1
end
end
}
Any help?