wait(14)
local player =game.Players.LocalPlayer
local frame =player:WaitForChild("StarterGui"):WaitForChild("LUDUSMORTIS"):WaitForChild("FRAMESCRIPT")
frame.Visible =false
task.wait(5)
frame.Visible = true
The goal of the script is to make the frame invisible.The script did not show any spelling errors.But when I start the game, the frame is not invisible. It is on the screengui and does not disappear. I was going to do a gui animation.
Your script is not working as âStarterGuiâ is not a valid member of a player. It changes to âPlayerGuiâ when the player is loaded into the game.
i think you shall check this line:
local frame=player:WaitForChild(âStarterGuiâ):WaitForChild(âLUDUSMORTISâ):WaitForChild(âFRAMESCRIPTâ)
check your frame s parent again
or
local statergui = player:WaitForChild(âStarterGuiâ)
local gui = startergui:WaitForChild(âLUDUSMORTISâ)
local frame script = gui:WaitForChild(âFRAMESCRIPTâ)
â do stuff
According to the error, you are directing to a LocalScript. This explains why the Visible property is not a valid member of a LocalScript.
However, I might help you using this script.
local player = game.Players.LocalPlayer
local frame = script.Parent -- // change this to the path of the UI or if the script is parented to the gui then keep it like this.
wait(14)
frame.Visible =false
wait(5)
frame.Visible = true
Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.
If a call to this function exceeds 5 seconds without returning, and no timeOut parameter has been specified,
a warning will be printed to the output that the thread may yield indefinitely;
I think your referencing to the a localscript, not a frame