Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can dictionaries print number strings?

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.

1 comment

0

Could you explain it more

2 answers

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.