#Issue with placeholders and variables

1 messages · Page 1 of 1 (latest)

split turret
#

If this looks right, I can send the Skript to the part that is adding coins:

    trigger:
        add(player, "speed", 5)

on join:
    set title of player's scoreboard to "     &6✦ &e&lAloraRNG &6✦     "
    set line 7 of player's scoreboard to " "
    set line 8 of player's scoreboard to "&b| INFORMATION"
    set line 9 of player's scoreboard to "&b| &7Luck: &a%get(player, "luck")%%%"
    set line 10 of player's scoreboard to "&b| &7Speed: &e%get(player, "speed")%"
    set line 11 of player's scoreboard to " "
    set line 12 of player's scoreboard to "&b| CURRENCY"
    set line 13 of player's scoreboard to "&b| &eCOINS: &6%get(player, "coins")%"
    set line 14 of player's scoreboard to "&b| &dSHARDS: &5%get(player, "shards")%"
    set line 15 of player's scoreboard to "&b| &aGEMS: &2%get(player, "gems")%"

function updateScoreboard(p: player, key: string, value: object):
    if {_key} = "luck":
        set line 9 of {_p}'s scoreboard to "&b| &7Luck: &a%{_value}%%%"
    else if {_key} = "speed":
        set line 10 of {_p}'s scoreboard to "&b| &7Speed: &e%{_value}%"
    else if {_key} = "coins":
        set line 13 of {_p}'s scoreboard to "&b| &eCOINS: &6%{_value}%"
    else if {_key} = "shards":
        set line 14 of {_p}'s scoreboard to "&b| &dSHARDS: &5%{_value}%"
    else if {_key} = "gems":
        set line 15 of {_p}'s scoreboard to "&b| &aGEMS: &2%{_value}%"

function add(p: player, key: string, value: number):
    {data::%{_p}'s uuid%::%{_key}%} is a number
    add {_value} to {data::%{_p}'s uuid%::%{_key}%}
    updateScoreboard({_p}, {_key}, {data::%{_p}'s uuid%::%{_key}%})

function subtract(p: player, key: string, value: number):
    {data::%{_p}'s uuid%::%{_key}%} is a number
    remove {_value} from {data::%{_p}'s uuid%::%{_key}%}
    updateScoreboard({_p}, {_key}, {data::%{_p}'s uuid%::%{_key}%})

function set(p: player, key: string, value: object):
    set {data::%{_p}'s uuid%::%{_key}%} to {_value}
    updateScoreboard({_p}, {_key}, {_value})

function get(p: player, key: string) :: object:
    return {data::%{_p}'s uuid%::%{_key}%} ? 0```
hexed nest
#

can you explain your issue?

split turret
# hexed nest can you explain your issue?
    trigger:
        set {_dirt} to amount of dirt in player's inventory
        set {_dirtprice} to {_dirt} * 1
        add(player, "coins", {_dirtprice})
        remove all dirt from player's inventory```
#

That is the command that adds coins

#

it removes the dirt

#

the problem is that it's not adding to the scoreboard

#

and I have no clue why

crisp minnow
#

can you try debugging? See if everything goes into add() correctly, and then into updateScoreboard()

crisp minnow
#

add broadcasts to make sure things are what you expect