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

Can dictionaries print number strings? [closed]

Asked by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago

Are dictionaries allowed to print numbers and "strings" at the same time. For example let's say we have 2 scripts and we wanted them to print " 1 Hi" and the other one to print 2 "XD". would it work.

0
Could you explain it more karlo_tr10 1233 — 4y

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
karlo_tr10 1233 Moderation Voter
4 years ago

I didn't understand your question but here is an example of printing from the dictionary:

local Dictionary  = {
["Stri"] = 1;
["Xd"] = "Hello";   
}

for i,v in pairs(Dictionary) do
    print(tostring(v))
end

--Prints 1 and Hello
Ad
Log in to vote
0
Answered by
b3wz 34
4 years ago

Not sure exactly what you mean but this is what you can do with tables/dictionaries:

local table = {1, "Hi"}
-- table[1] = 1, table[2] = "Hi"
local table = {
    Example = {
        "Hi",
        2,
    }
}
-- table.Example[1] = "Hi", table.Example[2] = 2