I made a script that makes gui visible after touched by a part and I made it so each frame contains textboxes that appear after another but after the first textbox appears, the rest don't work. Why isn't it working?
local Part = script.Parent Part.Touched:Connect(function(HIT) local H = HIT.Parent:FindFirstChild("Humanoid") if H then wait(5) local Player = game.Players:GetPlayerFromCharacter(HIT.Parent) Player.PlayerGui.ScreenGui.Frame.Visible = true wait(10) Player.PlayerGui.ScreenGui.Frame.Visible = false wait(5) Player.PlayerGui.ScreenGui.Frame2.Visible = true wait(2) Player.PlayerGui.ScreenGui.Frame2.Visible = false end end)
P.S. the script came from a part that makes these guis visible and localscript has nothing to do with this question
You cannot access descendants of Player.PlayerGui from the server since these are local instances and are non-existent to the server. To fix this, you will have to use a RemoteEvent and use that to change your UI on the client. I'm not entirely sure why the first frame wouls become visible, but moving it as a whole to the client is a sure fix.