Syndicate content

what is wrong with this script

4 posts / 0 new
Last post
Offline
Townie
Joined: 5 Sep 2010
what is wrong with this script

i am trying to learn scripting by following a tutorial but i found a scrip that constantly gets syntax errors on the last line. please help me figure out what is wrong.

module Slime_counter Counter_Variable = 1 Slime = [1]end

class Game_Enemy < Game_Battler Include Slime_Counter def die $game_varables[Counter_Variable] += if Slime.include?(enemy.id) @hp = 0 clear_states clear_buffs endend

egg_dragon's picture
Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 23 Oct 2005

I wish I could offer more assistance right now, but my computer which has XP and VX installed is in storage; my laptop only has RPG2k and 2k3.  But, just looking at what you posted, it's difficult for me to tell what might be the problem as the lines are not separated.  Could it be that there are just one too many, or too few, "end"s?  I haven't done a lot of scripting in a while so that's just a guess.

meustrus's picture
Offline
RoyalÜber TownieUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 18 Jan 2006

First let's get that pasted on different lines like it's supposed to be:

module Slime_counter
  Counter_Variable = 1
  Slime = [1]
end

class Game_Enemy < Game_Battler
  Include Slime_Counter
  def die
    $game_varables[Counter_Variable] +=
    if Slime.include?(enemy.id)
      @hp = 0
      clear_states
      clear_buffs
    end
end

I'd say the line with $game_variables is wrong. It should probably be this instead, but I'm not sure:

$game_varables[Counter_Variable] += 1
Offline
Townie
Joined: 16 Dec 2015

Individual switches for each lamp should work for your problem. It did for mine actually. - Dennis Wong YOR Health

Who's online

There are currently 1 user and 0 guests online.

Online users