I'm currently writing a script for a custom hot bar but im not sure which way I should go about it. The idea is to have a certain number of slots (say three for example), where tools will be placed in them, and if there is no tool in that slot, then it should say 'empty'. I do not want slots to auto sort so that removing a slot won't change other slots.
What I'm not sure about is if I should:
Make three slots and fill in and out tools as they go,
or
Add and remove slots (similar to how the default hotbar works), and add in 'empty' slots when needed
#Help structuring a hotbar script
17 messages · Page 1 of 1 (latest)
Help structuring a hotbar script
This could also not really matter in the end, just wondering if there's a cut and dry answer to this kind of problem
Have the slots already made but visible false if not used
Not really... It depends on what your end product want to be like
I do want the empty slots to be visible at all times since I only really plan to have three or four slots to be useable
Just wanting to make sure I dont write too much code for something that could be easier
Ok so first make the gui
Add a main frame and a UIListLayout to center the other instances
Thats what I've got so far
Then create the 3-4 frames
Create a frame viewport and a text label to write empty
Now create a script for it
First start with a table something like this:
local hotbar = {
[1] = "nil",
[2] = "nil",
[3] = "nil"
}
}
To have an empty hotbar
From here you just check the table and set the table values
I dont think I can explain every step so I will leave it to you
But if you need help you can ask me