assign player to variable

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

HumbleMC

Member
Nov 8, 2018
18
1
0
26
Hi all,

New to Skript and trying to set the player to a variable inside of skript.

The purpose of the command is to upgrade a player to a rank

I am trying to assign the players name to a variable so I can use it to give items.

The command itself is /BcUpgrade <player>, <text>

I need to assign that player parameter to a variable or if you guys know another way of giving a player an item that would be great :emoji_slight_smile:


Code:
code_language.skript:
command /BcUpgrade <player>, <text>:
    description: Upgrades player to rank.
    aliases: BcUpgrade
    usage: /BcUpgrade <player>, <rank>
    permission: donate.player
    trigger:
        make console execute command "/manuadd %arg 1% %arg 2%" 
        set {_player.text} to "%arg 1%"
        arg 2 is "Donor":
            make console execute command "/give %arg 1% 7 7"
            give _player 98 64
 
code_language.skript:
command /BcUpgrade <player>, <text>:
    description: Upgrades player to rank.
    aliases: BcUpgrade
    usage: /BcUpgrade <player>, <rank>
    permission: donate.player
    trigger:
        make console execute command "/manuadd %{_player}% %arg 2%"
        set {_player} to arg-1
        arg 2 is "Donor":
            make console execute command "/give %{_player}% 7 7"
            give {_player} 98 64 #you better use item names instead of ids, also make sure that you are using a newer version of skript(not the one from bukkit)
 
SOLVED!!
set {_player} to "%arg 1%"
code_language.skript:
command /BcUpgrade <player>, <text>:
    description: Upgrades player to rank.
    aliases: BcUpgrade
    usage: /BcUpgrade <player>, <rank>
    permission: donate.player
    trigger:
        make console execute command "/manuadd %{_player}% %arg 2%"
        set {_player} to arg-1
        arg 2 is "Donor":
            make console execute command "/give %{_player}% 7 7"
            give {_player} 98 64 #you better use item names instead of ids, also make sure that you are using a newer version of skript(not the one from bukkit)
Awesome thanks a million!!
[doublepost=1541784241,1541781272][/doublepost]
code_language.skript:
command /BcUpgrade <player>, <text>:
    description: Upgrades player to rank.
    aliases: BcUpgrade
    usage: /BcUpgrade <player>, <rank>
    permission: donate.player
    trigger:
        make console execute command "/manuadd %{_player}% %arg 2%"
        set {_player} to arg-1
        arg 2 is "Donor":
            make console execute command "/give %{_player}% 7 7"
            give {_player} 98 64 #you better use item names instead of ids, also make sure that you are using a newer version of skript(not the one from bukkit)
Hey, How can I include enchantments on these items?
 
code_language.skript:
give diamond sword of sharpness 1 and fire aspect 2 to player
 
Status
Not open for further replies.