Solved Need help with varible and name :)

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

BoxMiners

Member
Jul 19, 2022
47
0
6
18
Code:
on rightclick with written book:
    if name of player's held item contains "+" or "VIP":
        set {_rank} to name of player's held item split at "l"
        wait 1 tick
        make console execute command "lp user %player% parent set %{_rank}%"

It says Line 3: {_rank} can only be set to one object not more

idk what to do. If anyone have a solution please send it. The name of the book is "&6&lMVP+++"
upload_2022-10-18_11-28-4.png
 
split expression return a list of text, so you need
a)
Code:
set {_rank::*} to %text% split at %text%
or b)
Code:
set {_rank} to first element of (%text% split at %text%)
 
Code:
on rightclick with written book:
    if player's tool's name contains "VIP":
        set {_rank} to "VIP"
    if player's tool's name contains "+"
        set {_rank} to "VIP+"

    make console execute command "lp user %player% parent set %{_rank}%"

    cancel event
 
Status
Not open for further replies.