Button Input

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
222
Reaction score
65
First Language
English
Primarily Uses
N/A
This is stright of the script call sheet from the forum and I can't get it to work for the life of me.

if(Input.keyTriggered("t")){

var xPos = $gamePlayer.screenX();
var yPos = $gamePlayer.screenY();

$gameScreen.startZoom(xPos-20, yPos-30, 5, 10);


}

I got the Yanfly plugin for the button config, but its rejecting even if "ok" or something along those line is placed.

How do I create if condition attached to button input through scripting? Thanks
 

Nicke

Fortune seeker
Veteran
Joined
Apr 4, 2012
Messages
549
Reaction score
550
First Language
Swedish
Primarily Uses
RMMV
Try this instead:
Code:
if (Input.isTriggered('ok')) {
 // Do stuff
}
The above code will happen one time once the ok key is pressed. If you want it to happen multiple times use this:
Code:
if (Input.isPressed('ok')) {
 // Do stuff
}
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
222
Reaction score
65
First Language
English
Primarily Uses
N/A
Try this instead:
Code:
if (Input.isTriggered('ok')) {
 // Do stuff
}
The above code will happen one time once the ok key is pressed. If you want it to happen multiple times use this:
Code:
if (Input.isPressed('ok')) {
 // Do stuff
}
Hero! And @Nicke I just seen your 2 new plugins they look really good aswell!

Please mark as answered :) :D
 

Nicke

Fortune seeker
Veteran
Joined
Apr 4, 2012
Messages
549
Reaction score
550
First Language
Swedish
Primarily Uses
RMMV
Happy to help out! :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

We'll be doing another giveaway of MZ on the stream tomorrow! Thank you SykoGaming for contributing a copy for the community! :D
Sorry guys! Been away for long this time. Got attacked by my anxieties again. At least no more bedbugs. Got logged out of here and layout seems strange now a bit.
My old project is now a sitcom
How to do implementation the social politcal mechanics in rpg maker? Thank you for quick spark of ideas. Fear of going to the thread lol.

Forum statistics

Threads
100,781
Messages
979,472
Members
132,419
Latest member
memakegamemekillminority
Top