Essen said: Howdy. I've set a dice game as a token action on a dice tray token. I'm trying to reference the character wallet using the player ID, which is working as far as that it will display their character name based on the player ID based on a conditional. However, when I use this same variable to try and reverence their wallet... --:FindWallet| --?"[&SendingPlayerID]" -eq "-Myw..."|[--&CharName|Char--]| --?"[&PotType]" -eq "copper"|[--&Coin|CP--]| --?"[&PotType]" -eq "silver"|[--&Coin|SP--]| --?"[&PotType]" -eq "gold"|[--&Coin|GP--]| --?"[&PotType]" -eq "plat"|[--&Coin|PP--]| --&WalletID|@{[&CharName]|[&Coin]} --=Wallet|[&WalletID] --<| I get " No character was found for '[&CharName]'" I tried making the whole thing a string, then calling it to set the number, but to no avail. How would I get this to flatten enough to work? You can't use @{...} referencing with ScriptCards variables. This is because @{[&CharName]|[&Coin]} will be processed by the Chat server before ScriptCards gets passed the macro. Since the chat server doesn't know what [&CharName] (or [&Coin]) is, it is trying to find a character literally named [&CharName], which obviously doesn't exist. You need to use ScriptCards referencing to do this, so assuming you have a way to get a character id into a variable, you would use something like [*[&CharID]:[&Coin]] Assuming Coin is set to the name of an attribute on the character sheet. This can actually be shortened up a lot by using a case statement (--c) instead of separate conditionals. It will also run faster too: Note: the following assumes that at some point you have put the character id or a token id that represents a character into a variable called [&CharID] --c[&PotType]|copper:&Coin;CP|silver:&Coin;SP|gold:&Coin;GP|plat:&Coin;PP
--=Wallet|[*[&CharID]:[&Coin]]
--<| Using the sending player ID to determine a character is a small bit of work, but can be done. If you are using the system neutral library from the ScriptCards github (<a href="https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_Examples/libraries/systemneutrallib.scard" rel="nofollow">https://github.com/kjaegers/ScriptCards/blob/main/ScriptCards_Examples/libraries/systemneutrallib.scard</a>) there is a library function to do this for you (LibSN_GET_CONTROLLED_TOKENS_FROM_PAGETOKENS), which will get the tokens controlled by the sending player. ScriptCards can use the token id in place of a character id in [*...] referencing and will simply look up what character the token represents automatically. Finally, you may find you get quicker responses by posting in the ScriptCards thread instead of creating individual threads for each issue. There are several helpful folks that keep an eye on that thread and might miss new threads in the forum.