RPG Maker Forums

Hi guys,

I am trying to make a rock pullable if player can move backward direction

Code:
if ($gamePlayer.direction() == 2 ) {
$gameVariables.setValue(6, 8)
} else if ($gamePlayer.direction() == 4 ) {
$gameVariables.setValue(6, 6)
} else if ($gamePlayer.direction() == 6 ) {
$gameVariables.setValue(6, 4)
} else {
$gameVariables.setValue(6, 2)
}

dx = ($gamePlayer.x)
dy = ($gamePlayer.y)
db = ($gameVariables.value(6))

if ($game_player.passable?(dx, dy, db) ) {
$gameSwitches.setValue(11, true)
} else {
$gameSwitches.setValue(11, false)
}
as you see at first condition i am determining the direction of backwards and at second i am trying to make a switch on if it is passable after this i will move the player and boulder backwards if the switch is on.

in first if clause it's working like a charm but in second if clause i am having a "Syntax Error {" error.

What is the difference between these two? and why i am having this error, as i think these two clause are identical

Thanks for your help in advance.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top