Does anybody know how to make a GUI show up every minute to every player at the same time? Any help would be appreciated!
Details:
This is my script:
local startGui = game.ServerStorage.StartingGui while true do wait(60) for i, v in pairs(game.Players) do local GuiClone = startGui:Clone() GuiClone.Parent = v.PlayerGui end end
I got this error:
10:08:45.375 - ServerScriptService.Script:5: bad argument #1 to 'pairs' (table expected, got Object)
You need to use :GetPlayers()
after game.Players
Here is fixed script:
local startGui = game.ServerStorage.StartingGui while true do wait(60) for i, v in pairs(game.Players:GetPlayers()) do if v:FindFirstChild("PlayerGui") then -- Check for PlayerGui local GuiClone = startGui:Clone() GuiClone.Parent = v.PlayerGui end end end
Wiki pages:
Errors? tell-me on comments.
Hope it helped :)