Hello, i need help with this script, its supposed to be an open and close button for a gui that allows people in your plot, and when you open it, its supposed to open a list with all the players except yourself, and the buttons come from the open button, as you can see in the code, but when i click it, nothing appears on the list, the list is only blank.
local val = script.Parent:WaitForChild("Open")
script.Parent.MouseButton1Click:Connect(function()
if val.Value ~= true then
val.Value = true
for i,p in pairs(game.Players:GetChildren()) do
script.Parent.Parent.Frame:ClearAllChildren()
local btn = script.Parent.Parent.Template:Clone()
btn.Parent = script.Parent.Parent.Frame
btn.Name = p.Name
btn.PlayerName.Text = p.Name
if p[script.Parent.Parent.Parent.Parent.House.Value.ID.Value].Value ~= true then
btn.PlayerButton.Text = "Allow"
else
btn.PlayerButton.Text = "Unallow"
end
end
script.Parent.Parent.Frame.Visible = true
else
val.Value = false
script.Parent.Parent.Frame.Visible = false
end
end)
```.
Can anybody help me out?