Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to have two strings in a dictionary?

Asked by 6 years ago
Edited 6 years ago

local Cost = { ["Dropper"] = {Cost = 1, Currency = "Cash"} }

I want to be able to buy items, structures and other things with more than one currency.

Is there a way to add 2 or more strings the Currency so it looks something like:

--Text below in this block work just an example of how I thought it would look.--

Currency = "Cash","Wood","Stone"

--Text below in this block work just an example of how I thought it would look.--

However the way I show below is messy and it doesn't seem efficient. It works bust just looking for a better solution.

local Cost = { ["Dropper"] = {Cost = 1, Currency = "Cash", Currency1 = "Wood", Currency2 = "Stone"} }

Thanks! - Lost Phantom

0
One approach you could try is Currency = ['cash', 'wood', 'stone'] and have a function just concatenate it all. ScrewDeath 153 — 6y
0
Solves the majority of the problem, with a couple modifications I can make it work. Thanks! Lost_Phantom 4 — 6y

Answer this question