- 10
- Posts
- 3
- Years
- Seen Jun 13, 2022
I know pretty much nothing about coding but I want to create a move function where a custom move adds 1 to a variable when you use it. It seems simple so I imagine it's not hard but again, I don't know squat about coding and instead of watching an hour long YouTube video I'm just going to ask you guys. You can just call the variable 'test' for this example.
Edit: I figured out how to use add variables but for some reason it isn't sticking after battle. Here's the code I used:
class PokeBattle_Move_200 < PokeBattle_Move
def pbEffectAfterAllHits(user,target)
return if !target.damageState.fainted
return if !user.pbCanRaiseStatStage?(:ATTACK,user,self)
$game_variables[0026] += 1
end
end
For a base I used fell stinger
Edit: I figured out how to use add variables but for some reason it isn't sticking after battle. Here's the code I used:
class PokeBattle_Move_200 < PokeBattle_Move
def pbEffectAfterAllHits(user,target)
return if !target.damageState.fainted
return if !user.pbCanRaiseStatStage?(:ATTACK,user,self)
$game_variables[0026] += 1
end
end
For a base I used fell stinger
Last edited: