Answered by
5 years ago Edited 5 years ago
StarterGui
acts a container for GUIs, it does not actually represent the authentic household origin of where the active User Interfaces are properly stored.
Upon connection, these GUIs get replicated over to the PlayerGui
, to operate with the desired UI, you must always reference it through the authentic location.
01 | local player = game:GetService( "Players" ).LocalPlayer |
02 | local playergui = player:WaitForChild( "PlayerGui" ) |
04 | local textbutton = script.Parent |
05 | local frame = playergui.ScreenGui.Frame |
07 | script.Parent.MouseButton 1 Click:Connect( function () |
08 | script.Parent.Parent.Visible = false |
11 | script.Parent.MouseEnter:Connect( function () |