I'm trying to TweenPosition of Gui PlayerGui.GUI.Blue by button using ClickDetector and I wanna do that for all players at once.
Code I'm using:
script.Parent:WaitForChild("ClickDetector")
local clickdetector = script.Parent.ClickDetector
clickdetector.MouseClick:Connect(function()
for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.GUI.Blue:TweenPosition(UDim2.new(0.009, 0, 0.9, 0))
end
end)
Error that shows up in Output:
23:00:04.534 - GUI is not a valid member of PlayerGui
23:00:04.537 - Stack Begin
23:00:04.539 - Script 'Workspace.Button.Script', Line 6
23:00:04.540 - Stack End
(GUI is a member of PlayerGui)

1 comment
use wait for child