Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

character crouch script request :3

Hello :3

I'm Sarah and I found one

script that you can only control your character

to left and right but, I need script so that my

character can crouch (like Ragnarok)

when you press key :(

Can someone help me :3?

Sankyou :3
 
You might want to better specify what you are wanting.

If you are just wanting to change the movement speed, sprite, etc. when I button is pressed, here is something:

Code:
module CrouchSystem
  Button = Input::X
  Sprite_Suffix = '_crouch'
  Move_Speed = -1
end

class Game_Player
  alias_method :seph_crouchsystem_gmactr_cn, :character_name
  alias_method :seph_crouchsystem_gmplyr_update, :update
  def character_name
    return seph_crouchsystem_gmactr_cn + (@crouching ? CrouchSystem::Sprite_Suffix : '')
  end
  def update
    seph_crouchsystem_gmplyr_update
    if Input.trigger?(CrouchSystem::Button)
      if @crouching
        @crouching = false
        @move_speed -= CrouchSystem::Move_Speed
      else
        @crouching = true
        @move_speed += CrouchSystem::Move_Speed
      end
    end
  end
end

Try that. ^_^
       
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top