Solved Custom Command Help

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Only_Dans

Member
Dec 19, 2021
4
0
1
34
I am trying to create a command that will respawn the player for a cost of $10000 by typing /respawn. I am using the vault plugin for the economy. I can't get it to work correctly. This is my skript currently.

command /rsp:
description: This will buy you back to life for $10000
permission: sk.respawn
permission message: &cYou cannot preform this command!
trigger:
if player's %vault_eco_balance% is greater than or equal to 10000:
remove 10000 from player's %vault_eco_balance%
set player's gamemode to survival
message "You have been revived!" to player
if player's %vault_eco_balance% is greater than or equal to 10000:
message "You don't have enough money!" to player

When I reload the script in game it tells me this

Can't compare 'player's %vault_eco_balance%' with an integer (Respawn.sk, line 6: if player's %vault_eco_balance% is greater than or equal to 10000:')
Can't compare 'player's %vault_eco_balance%' with an integer (Respawn.sk, line 10: if player's %vault_eco_balance% is lesser than 10000:')

Can someone explain why I can't get it to run?
 
try


command /rsp:
description: This will buy you back to life for $10000
permission: sk.respawn
permission message: &cYou cannot preform this command!
trigger:
if balance of player <= 10000:
remove 10000 from the player's account
set player's gamemode to survival
message "You have been revived!" to player
if balance of player <= 10000:
message "You don't have enough money!" to player
 
try


command /rsp:
description: This will buy you back to life for $10000
permission: sk.respawn
permission message: &cYou cannot preform this command!
trigger:
if balance of player <= 10000:
remove 10000 from the player's account
set player's gamemode to survival
message "You have been revived!" to player
if balance of player <= 10000:
message "You don't have enough money!" to player

That made it work. Thank you
[doublepost=1639961290,1639959045][/doublepost]
That made it work. Thank you
try


command /rsp:
description: This will buy you back to life for $10000
permission: sk.respawn
permission message: &cYou cannot preform this command!
trigger:
if balance of player <= 10000:
remove 10000 from the player's account
set player's gamemode to survival
message "You have been revived!" to player
if balance of player <= 10000:
message "You don't have enough money!" to player


It doesn't error out anymore but it only works if I have exactly 10000. If I have more then that it tells me "You don't have enough money!" Is there another way to express greater than or equal to?
 
That made it work. Thank you
[doublepost=1639961290,1639959045][/doublepost]



It doesn't error out anymore but it only works if I have exactly 10000. If I have more then that it tells me "You don't have enough money!" Is there another way to express greater than or equal to?
well try
[doublepost=1639972666][/doublepost]command /rsp:
description: This will buy you back to life for $10000
permission: sk.respawn
permission message: &cYou cannot preform this command!
trigger:
if balance of player < 10000:
remove 10000 from the player's account
set player's gamemode to survival
message "You have been revived!" to player
if balance of player < 10000:
message "You don't have enough money!" to player
 
Status
Not open for further replies.