#Scripting assistance :)

1 messages · Page 1 of 1 (latest)

patent yoke
#

Hey! So about 3–4 years ago, I switched to Unity full-time, but now I’m trying to make a Roblox game for my little brother. It’s been a while, and I feel like I’ve lost the hang of Lua and Roblox Studio a bit.

Quick question for anyone more in the loop—does it make sense to store GUI elements like Health, Hunger, Thirst, and Infection in a table instead of using separate local variables for each one?

I know it’s a small detail, but I care about writing clean, efficient code, and I’m curious if that kind of structure makes a difference in performance or readability.Haroldhappy

lofty trail
#

I don't see why the hell not

wispy vapor
patent yoke
ember token
#

It makes no difference

#

might be better to keep it in the table

wispy vapor
patent yoke
patent yoke
#

Tables are usable anywhere, but the question here isn't the functions, it's the raliability and readability...

ember token
#

guess it depends how much ur brother knows, variables might be easier to understand starting out but tables are better practice

patent yoke
#

He already knows the basics, I've taught him a few things here and there.

dense grailBOT
#

studio** You are now Level 1! **studio

peak otter
#

It makes 0 difference, if you find it to be more readable you should def go for it

wispy vapor
gaunt silo
dense grailBOT
#

studio** You are now Level 22! **studio

peak otter
#

It's unrelated to the authors post but he was trying to say the same thing

gaunt silo
#

You said local variables were usable under the line they were defined which is not entirely false but not entirely true either

patent yoke
dense grailBOT
#

studio** You are now Level 5! **studio

gaunt silo
wispy vapor
#

fuck yall