Check Move Speed in Script Call

I'm trying to make an object check the player's move speed when triggered. The pseudocode would be like this:

$if game_player.move_speed >= 6

# Some code here.

$end

Also, how do you do greater than or equal to/less than or equal to in a script call? By a script call I mean by using the script event command.
Code:
if $game_player.move_speed >= 6  #Some code hereend
If you're gonna use it on a conditional branch, just add
Code:
$game_player.move_speed >= 6
Hmm. I did the one in the conditional branch and got this error:

----

NoMethodError occurred while running script.

undefined method ` move_speed' for #<Game_Player:0x1361450>

----

Are you sure that's the right syntax for RPG Maker XP?
Ah, I hadn't noticed you use XP, I'll check on XP when I get home.
Sounds good.
Try adding this in a new script before Main:

Code:
class Game_Character  attr_reader :move_speedend
And then use the same code I said earlier.
It works! Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/check-move-speed-in-script-call.45905/