So here is the script:
function move() for k,p in pairs(game.Players:GetChildren()) do gui=p.PlayerGui:FindFirstChild("Notifications") print("Found gui") gui:WaitForChild("Frame") gui.Frame.Visible=true print("Visible") for i=1,30 do gui.Frame.Position=gui.Frame.Position+UDim2.new(0,0,.05,0) wait(.01) end print("Moved") end end
It works once, but then if I try again, output tells me
Frame is not a valid member of ScreenGui
Script 'Workspace.Script', line 36 - global move
script 'Workspace.Script', Line 84
Stack End
The Line 84 is this: (I used -- to tell the line number in the actual script)
for k,plr in pairs(game.Players:GetPlayers()) do--81 plr.PlayerGui.Notifications.Frame.TextLabel.Text="SFT2 has been loaded. Please wait for further instruction"--82 plr.PlayerGui.Notifications.Frame.Visible=true--83 move()--84 wait(3)--85 plr.PlayerGui.Notifications:Destroy()--86 end --87
GUI Function:
function GUI() for k,plr in pairs(game.Players:GetPlayers()) do model=game.ServerStorage:FindFirstChild("Notifications") guiclone=model:Clone() guiclone.Parent=plr.PlayerGui end end