#variables not working

1 messages · Page 1 of 1 (latest)

frosty vine
#

how does your trading work

#

also please learn skbee, it's alot more efficient and responsive than skrayfall! (Scoreboard)

#

also to fix <none> when your value is 0, do

"%{purse::%player's uuid%} ? 0%"

#

@rustic python please check how your variables look!

#
on inventory click:
    if event-inventory = (metadata tag "Shop" of player):
        cancel event
        if index of event-slot is 10:
                add 1 to {purse::player's uuid}
                send "%{purse:player's uuid}%" to player

what do you think is wrong

#

look carefully

#

not just that

#

there's more

#

what do you think player's uuid is in skript?

A) Expression
B) Condition
C) Type
D) Nothing

#

yes!, and what do you think %% does when expressions are surrounded with it?

#

imma just explain why

%{purse::player's uuid}% ❎
%{purse::%player's uuid%}% ✅

#

basically {purse::player's uuid} results in just a variable

meanwhile
{purse::%player's uuid%} results in a list

Ex.
{purse::player's uuid} = {purse::player's uuid}
{purse::%player's uuid%} = {purse::.vYaori's UUID}

#

yes

#

yes

#

correct

#

send your whole scoreboard

#

looks messy when its in skrayfall

#

here's skbee's syntax, install skbee, its 10x better

#
on join:
    while player is online:
        myScoreboard(player)
        wait 1 second


function myScoreboard(p:player):
        set line 3 of {_p}'s scoreboard to "&8▪&7 ᴏɴʟɪɴᴇ: &a%{_online}%/&a%max amount of players%&7"
        set line 2 of {_p}'s scoreboard to "&f"
        set line 1 of {_p}'s scoreboard to "&6ᴘᴀʀᴀᴛᴇx.ᴍɪɴᴇʜᴜᴛ.ɢɢ"

Just do the rest also install:

frosty vine
#

send your whole code @rustic python

#

also do /sk info

#

looks fine tho

#

lmao

#

dont use loop-player!

#

use {_p} instead!

#

{luck::%loop-player%} - > {luck::%{_p}'s uuid%}
loop-player -> {_p}

#

yes

#

%{purse::%{_p}'s uuid%}%

#

;-;

#

send your purse command

#

because that's only a singular variable

#

not a list

#

how do you add numbers to your purse

#

bingo

#

where's the % %

#

do you know where it lacks %%?

#

no, it'll work

#

just add 1 to the purse

#

add any number to the purse

#

and check if the scoreboard updates

#

wdym

#

you want to reset it?

#
command /reset:
    trigger:
        delete {purse::*}
#

just insert that code then do /reset

#

then remove the code again

#

it'll result in <none>

#

yes

frosty vine
#

to fix it, we can do %{purse::%player's uuid%} ? 0%

#

where do you think the <none> shows?

#

and?

#

there's more

#

yes!

#

what variable do you replace it with in /purse

#
command /purse:
    trigger:
        send "&6&lYour Purse Has: %{purse::%player's uuid%}% &6&lCoins" to player
#

think

#

bingo!

#

send your scoreboard

#

in explanation

? 0 means if the variable is not set (many reasons like its not set or has been deleted)

it replaces it with 0

#
        set line 12 of {_p}'s scoreboard to "&8▪ &7ʙᴀʟᴀɴᴄᴇ &6%{purse::%{_p}'s uuid%}% ♣"

what do you think get's replaced here?

#

to avoid <none>

#

spot on!

#

is there anything else you need help with?