Long story short, I have a leader board that shows the players job title and a script with the globals in which contain arrays of all the info about those jobs.
I'm trying to print the value of one of the jobs, but to find out which job the player has it gets the name from the leader board and which is the same name as the global var, then grabs the amount of money they earn from that array.
For example;
Job = game.Players.LocalPlayer.leaderstats.Job.Value
print('_G.' .. Job .. '[3]')
And here is the global in another script...
_G.WesteriesEmployee = {"WesteriesEmployee",2,40,"Westeries Employee"} -- Food+Drink Shop Cashier
So basically I need to to grab the name of the job from the leader board, realise that it's going to grab the info from the global var/array and then print the result instead of printing this...
_G.WesteriesEmployee[3]
Thanks in advance for any help!

1 comment
Thanks for the answer it gave me a bit of an insight into it. I worked it out exactly how you did it before reading your answer but had no idea why it worked that way. So thanks a lot!