I’m trying to make a system that loads every player’s name into a textbutton with designated properties every time a RemoteEvent is fired. It should be working - the print is there indicating that it is.
For some reason, when I run the code, nothing happens:
it’s just an empty grid
The script looks like this, very simple:
local grid = script.Parent.Grid
game.ReplicatedStorage.OneVOne.Refresh.OnClientEvent:Connect(function()
wait(1)
for i, v in pairs(game.Players:GetChildren()) do
local newbutton = Instance.new("TextButton", grid)
newbutton.Name = v.Name
newbutton.BackgroundColor3 = Color3.new(1, 0.0784314, 0.247059)
newbutton.TextColor3 = Color3.new(1, 1, 1)
newbutton.Font = Enum.Font.Bangers
newbutton.TextTransparency = 0
newbutton.TextColor3 = Color3.new(0, 0, 0)
newbutton.Text = v.Name
print("Created your button")
end
end)
In fact, it even shows the textbutton in it in PlayerGui when I run the game. All visible Booleans are set to true don’t worry abt that lol.