http://pastebin.com/raw.php?i=3RaCFNAZ
im trying to make a gui for my admin, but for some reason, i cant get this part to work!
players = game.Players:GetChildren()
for i = 1, #players do
local screenGui = Instance.new("ScreenGui", game.Players.players[i].PlayerGui )
local imageLabel = Instance.new("ImageLabel")
imageLabel.Image = "http://www.roblox.com/asset?id=46974682"
imageLabel.Parent = screenGui --up r l down
imageLabel.Position = UDim2.new(0, 500, 0, 0)
imageLabel.Size = UDim2.new(0, 300, 0, 150)
-- Create TextButton
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Transparency = 1
textButton.Position = UDim2.new(0, 500, 0, 0)
textButton.Size = UDim2.new(0, 300, 0, 150)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Remove RuntoAdmin V.3 GUI"
-- Bind function to button click
textButton.MouseButton1Down:connect(function()
textButton.Text = "Removing..."
imageLabel.Transparency = 0
t = 1
a = 300
b = 150
while true do
wait(0.05)
a = a-1
b = b-1
imageLabel.Size = UDim2.new(0, a, 0, b)
end
end
)
end
the error:
attempt to index field "players" (a function value)
please help!

3 comments
code block please!
You may want to use an iterative for loop for the players instead of a numerical for loop. Also, on line 16 .Color is not needed
Thanks! it works now.