hello. im trying to move a gui object to each player after 4 seconds. but somehow its not including everyone.
code:
task.wait(4)
for a,b in ipairs(game.Players:GetChildren()) do
local Gui = script.GUI.Value:Clone()
Gui.Parent = b.PlayerGui
end
task.wait()
script.CUTSCENE_CONTROLLER:Fire()
task.wait(2 * 16)
for a,b in ipairs(game.Players:GetChildren()) do
if b.PlayerGui:FindFirstChild(script.GUI.Value.Name) then
b.PlayerGui:FindFirstChild(script.GUI.Value.Name):Destroy()
end
end
script.CUTSCENE_MODEL.Value:Destroy()
task.wait(4)
for _, b in game.Players:GetPlayers() do
script.GUI.Value:Clone().Parent = b.PlayerGui
end --this loop should be serversided
task.wait()
script.CUTSCENE_CONTROLLER:Fire()
task.wait(32)
for _, b in game.Players:GetPlayers() do
if b.PlayerGui:FindFirstChild(script.GUI.Value.Name) then
b.PlayerGui:FindFirstChild(script.GUI.Value.Name):Destroy()
end
end
script.CUTSCENE_MODEL.Value:Destroy()