- Joined
- Jan 13, 2019
- Messages
- 27
- Reaction score
- 5
- First Language
- English
- Primarily Uses
- RMVXA
So I was working on the shop steal script, adding a switch based event.
The consequences worked perfectly without the if statements. I have been working on this code for a while now, and adding else doesn't work.
The problem is that the 2nd if statement is activates regardless weather or not switch 6 is on.
Does anyone know how to fix this?
The consequences worked perfectly without the if statements. I have been working on this code for a while now, and adding else doesn't work.
The problem is that the 2nd if statement is activates regardless weather or not switch 6 is on.
Does anyone know how to fix this?
Code:
def do_steal(number)
if $game_switches[6] = false
life_or_death = rand(100)
if life_or_death <= 50
$game_party.gain_item(@item, 1)
else
$game_switches[21] = true
SceneManager.goto(Scene_Map)
end
end
if $game_switches[6] = true
$game_switches[22] = true
SceneManager.goto(Scene_Map)
end
end