When add button is clicked, there is something added to talbe and viseversa.
What is the issue?
i can’t even get the buttons to register
local t = {}
local remove = script.Parent.Parent.buttons.removeSomething
local add = script.Parent.Parent.buttons.addSomething
local label = script.Parent.Parent.buttons.TextLabel
print(t)
add.MouseButton1Click:Connect(function()
table.insert(t,1,"New Item")
print("clicked")
label.Text=t
end)
remove.MouseButton1Click:Connect(function()
table.remove(t,1)
print("clicked")
label.Text=t
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Try waiting for the buttons. By the way, are there any errors in the output?
script.Parent.Parent:WaitForChild("buttons") -- wait for "buttons"
local tableremove = script.Parent.Parent.buttons:WaitForChild("removeSomething")
local add = script.Parent.Parent.buttons:WaitForChild("addSomething")
local label = script.Parent.Parent.buttons:WaitForChild("TextLabel")
You’re trying to set a Text Value to a Table, you’re going to have to change it to something like; label.Text = t[1] the 1 is the position of the value in the table.