roblox dictionary code example

Example 1: create a dictionary in roblox

-- Add a Module Script into the ServerScriptStorage

local speechMod = {}

	speechMod.speech = {
		["quest1"] = {	
			["line1"] = "Hi this is quest 1",
			["line2"] = "I have a Quest for you",
			["line3"] = "Come back when your done"
		}, -- end quest1
	
		["quest2"] = {	
			["line1"] = "Hi this is quest 2",
			["line2"] = "You have completed quest 1, great",
			["line3"] = "Get me some Food bro"
		} -- end quest2
	} -- end speechMod.speech


return speechMod

-- LUA Scripting Language (For Making Games in Roblox)

Example 2: roblox studio dictionary

local inventory = {    ["Gold Bars"] = 4,    ["Healing Potions"] = 1,    ["Cups of Coffee"] = 3000}

Tags:

Misc Example