I made a script it works perfect but one problem.. just for one player tested for two players and it doesn't work just one time but not a second time. How can this get fixed? Thanks.
Script in Workspace and Gui in script*
game.Players.PlayerAdded:connect(function (Players) while true do wait (5) a = script:findFirstChild("EventsGui"):Clone() a.Parent = Players.PlayerGui wait (5) a.Parent = Players.PlayerGui:findFirstChild("EventsGui"):remove() end end)
It's probably because of line 8 for two reasons:
:Remove() is deprecated so it would be better to use :Destroy()
You're making the parent of a script itself and then destroying the script.
After getting the error on line 8, it probably stops the entire script.
Your most likely not using a local script. GUIs usually use local scripts to perform single player functions. Keep in mind however you may need to change your code if you change a script to a local script.