I'm trying to make it so that an actor gets revived when he dies if variable 5 is greater than 0. I'm using the scripts: xrxs tales of symphonia abs and game over when actor dies. I tried editing the game over when actor dies script so that it has this:
But I get an error:
Script 'Game Over when actor dies' line 21:NameError occured.
undefined local variable or method `actor' for #<Game_Actor:0x3d200a0>
Code:
Actor_ID = 1
class Game_Actor
#--------------------------------------------------------------------------
# * Change HP
# hp : new HP
#--------------------------------------------------------------------------
def hp=(hp)
@hp = [[hp, maxhp].min, 0].max
# add or exclude incapacitation
for i in 1...$data_states.size
if $data_states[i].zero_hp
if self.dead?
#start editing
if $game_variables[5] > 0
actor.hp += actor.maxhp
$game_variables[5] -= 1
else
#end editing
if @actor_id == Actor_ID
$game_temp.gameover = true
return
end
#start editing
end
#end editing
add_state(i)
else
remove_state(i)
end
end
end
end
end
But I get an error:
Script 'Game Over when actor dies' line 21:NameError occured.
undefined local variable or method `actor' for #<Game_Actor:0x3d200a0>