also i used this local script to clone text buttons
local Folder = game.Lighting.Folder
for i, v in pairs(Folder:GetChildren()) do
if v:IsA("Model") then
local TextButton = script.Parent.TextButton:Clone()
TextButton.Parent = script.Parent
TextButton.Name = v.Name
TextButton.Text = v.Name
end
end
local Lighting = game:GetService("Lighting")
local Folder = Lighting.Folder
local Button = script.Parent
print("Button name is:",Button.Name,"\nnow check if Folder has ",Button.Name)
local Model = Folder[Button.Name]
function onMouseButton1Click()
Model.Parent = workspace
end
Button.MouseButton1Click:Connect(onMouseButton1Click)
local Folder = game.Lighting.Folder
for i, v in pairs(Folder:GetChildren()) do
if v:IsA("Model") then
local TextButton = script.Parent.TextButton:Clone()
TextButton.Parent = script.Parent
TextButton.Name = v.Name
TextButton.Text = v.Name
--other properties here
end
end