currently I’m working on a heart sorting system which would be able to take different variants of hearts and sort them by priority into an new list which can then be converted into the gui, however I have reached a point of confusion on how I could get the current system how I intended, currently I can’t even run the code as I can’t use nested lists in order to determine the hearts, Any feedback on what I could do to make this work or on the code in general
local counter=0
anim_full=hash("full")
anim_empty=hash("empty")
local heartcounter=56
local hearttable={0}
local deadheart="bruh"
local newtable = {}
local priority=0
local function clonehearts(self,garnish,bread)
self.clone= gui.new_box_node(vmath.vector3(0,0,0),vmath.vector3(70,65,0))
gui.set_texture(self.clone, "heart")
self.location=gui.set_screen_position(self.clone,vmath.vector3(heartcounter,690,0))
if garnish == "spicy" then
gui.play_flipbook(self.clone, "Spicy")
else
gui.play_flipbook(self.clone, "full")
end
self.heart = {garnish, "nul", self.priority}
end
local function redraw(self)
while counter < #currenttable do
if currenthearts[counter[0]]=="spicy" then
self.priority = self.priority + 1
end
table.insert(newtable,self.priority,currenthearts))
counter=counter+1
end
counter = 0
while counter< #currenttable do
collision_response
clonehearts(self,newtable[1],newtable[2])
end
end
function init(self)
msg.post("/player character#pc script","heartsync",{hearts})
redraw(self)
end