Give a random amount of experience points to the player

  • 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.

daknus

Member
Jan 17, 2018
3
0
0
20
Hello,

I am trying to give a random amount of experience points to the player using this:

code_language.skript:
give a random number between {_emin} and {_emax} exp to the player

but it just returns this:

code_language.skript:
('a random number between {_emin}' and '{_emax} exp') can't be added to a player because the former is neither an item type, an inventory nor an experience point

How do I do this properly?
 
Try this, this is using the tuske expression
code_language.skript:
command /exp:
    trigger:
        set {_n} to a random number between 1000 and 2000
        add {_n} to xp of player
 
Maybe use this way if you don't want to use or add tuske on your server:
code_language.skript:
command /orb:
    trigger:
        make console execute command "/xp %random integer between 1 and 1000% %player%"
 
  • Like
Reactions: Wynnevir
Try this, this is using the tuske expression
code_language.skript:
command /exp:
    trigger:
        set {_n} to a random number between 1000 and 2000
        add {_n} to xp of player
This is vanilla skript
 
Maybe use this way if you don't want to use or add tuske on your server:
code_language.skript:
command /orb:
    trigger:
        make console execute command "/xp %random integer between 1 and 1000% %player%"
I don't really get why people avoid using addons, it doesn't hurt anyone and TuSKe is a pretty useful addon, oh well.

The problem was that you can't use expressions in type values, you'll have to parse it as experience for it to work.

This is vanilla skript
Skript doesn't have a xp expression, it only has level and level progress.
 
Status
Not open for further replies.