I need help getting the values of this table. I’ve followed every tutorial because I couldn’t get it to work the first time but it still doesn’t do anything.
I have tried to change how it prints before and it either returns an error or nil.
I’m trying to get all of the barbershop info. Name, Picture, Desc, Etc then put it on a GUI
local jobs = {
Barber = {Name = "Barber", Image = "rbxgameasset://Images/BarberImage", Info = "Cutting hair is what we do! Quick start-up, no education needed! Just show up and well give you a job!"},
GameShop = {Name = "Game Retail", Image = "rbxgameasset://Images/GameRetailImage", Info = "Power to the gamers is our modo! Join us to sell all the games you can think of. Promotion increases pay greatly"},
}
local button = script.Parent
local toggled = false
local jobFrame = script.Parent.Parent.Parent.Parent.JobsBox.JobsFrame
local settingBox = script.Parent.Parent.Parent.Parent.JobsBox
local function onButtonActivated()
if toggled == false then
toggled = true
settingBox.Visible = true
for index = 1, #jobs do
local itemString = jobs[index]
print("Index " .. index .. ": " .. itemString)
end
jobFrame.JobBox.Info.TextFrame.Text = jobs.Barber.Info
jobFrame.JobBox.Info.TextFrame2.Text = jobs.Barber.Info
jobFrame.JobBox.JobImage.Image = jobs.Barber.Image
jobFrame.JobBox.Data.JobName.TextLabel.Text = jobs.Barber.Name
else
toggled = false
settingBox.Visible = false
end
end
button.Activated:Connect(onButtonActivated)