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

PlayerGui children not working? [UNANSWERED]

script.Parent.Touched:connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player then
		local playergui = player:WaitForChild("PlayerGui")
		if playergui then
			local shophud = playergui:WaitForChild("ShopHUD")
			if shophud then
				local shopframe = shophud:WaitForChild("ShopFrame")
				if shopframe then
					shopframe.Visible = true
				end
			end
		end
	end
end)

This seems to stop at line 6 when I add prints to see where it will stop. Their is no error in the output, and it works on Play Solo, but not on servers or online. Please help.

7 comments

0

Are you sure ShopHUD is a child of PlayerGui? Also, Scripts can't access PlayerGui when FE is enabled.

0

Well the ShopHUD is in StarterGui, and when I go into the PlayerGui it is their, and how can I tell if filtering enabled is on??

0

It's under the property's of workspace.

0

Oh yeah it was ticked, so it should work now??

0

Yeah

0

For the record though, FE is very useful and I'd recommend keeping it checked. You would need to use Remote Events to change the PlayerGui using the normal script with FE.

0

Yeah I got it working, but quick question, how can I change a players leaderstats? Like add certain points to them? Would I need to like use a remoteevent to get into a localscript to award them the points?

1 answer

I'm pretty sure you have clone your gui into the player I think .

1 comment

0

The gui is automatically put into the playergui

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