Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why aren't my textbox guis appearing after the first textbox?

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

1 answer

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.

3 comments

0

where do i put the remote event

0

and how do i use it for ui changing?

This discussion is preserved as it was. New answers, comments, and votes are closed.