When I hover my mouse over the button that I've created it will not play the sound effect??
Please help me!
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end) script.Parent.MouseEnter:Connect(function() script.Sound:Play() end)
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.
local player = game:GetService("Players").LocalPlayer local playergui = player:WaitForChild("PlayerGui") local textbutton = script.Parent local frame = playergui.ScreenGui.Frame script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end) script.Parent.MouseEnter:Connect(function() script.Sound:Play() end)