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

Finding TextLabel in Player Gui, Only Works in Studio?

gui = script.Parent.Parent.Rarity
function enter()
	gui.Visible=true
end
function leave()
	gui.Visible=false
end

script.Parent.MouseEnter:connect(enter)
script.Parent.MouseLeave:connect(leave)

This works in studio single player testing, but going onto a server gives an error on line 1 saying that Rarity is not part of the Frame it's in. Any help with this?

2 comments

0

Is this a normal script and is filtering enabled on?

0

It's a localscript with Filteringenabled off

1 answer

✓ Accepted answer
gui = script.Parent.Parent:WaitForChild("Rarity") --this has happened to me too, but adding "WaitForChild" will make the script wait until the object is loaded or found.
script.Parent.MouseEnter:connect(function() -- more efficient than the other method you were using.
	gui.Visible = true
end)
script.Parent.MouseLeave:connect(function()
	gui.Visible = false
end)

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