local startmenugui = game.StarterGui:WaitForChild("startmenugui")
local playbutton = game.StarterGui:WaitForChild("startmenugui"):WaitForChild("Frame"):WaitForChild("frameplay"):WaitForChild("Play")
playbutton.MouseEnter:Connect(function()
playbutton.BackgroundTransparency = 0
playbutton.BackgroundColor3 = Color3.new(81, 96, 165)
startmenugui.Frame.frameplay.Position = UDim2.new ({0.468}, {0,0.143, 0})
startmenugui.Frane.frameplay.Size = UDim2.new ({0.532, 0},{0.06, 0})
game.StarterGui:WaitForChild("SoundFX"):WaitForCHild("Hoversound"):Play()
end)
playbutton.MouseLeave:Connect(function()
playbutton.BackgroundTransparency = 1
startmenugui:WaitForChild("Frame"):WaitForChild("frameplay").Position = UDim2.new ({0.565, 0},{0.143, 0})
startmenugui:WaitForChild("Frame"):WaitForChild("frameplay").Size = UDim2.new ({0.435, 0},{0.06, 0})
game.StarterGui:WaitForChild("SoundFX"):WaitForCHild("Hoversound"):Stop()
end)
✓ ANSWER ACCEPTED
[]HELP[]URGENT[]GUI Scripts unresponsive and nothing comes out in output?
1 answer
✓ Accepted answer
You are trying to detect the GUI in starterGUI instead of playerGUI
so instead of this
local playbutton = game.StarterGui:WaitForChild("startmenugui"):WaitForChild("Frame"):WaitForChild("frameplay"):WaitForChild("Play")
you need this
local player = game.Players.LocalPlayer
local playbutton = player.PlayerGui:WaitForChild("startmenugui"):WaitForChild("Frame"):WaitForChild("frameplay"):WaitForChild("Play")
also ill assume this is made in localscript, if not, put it on localscript
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Marked as non-descriptive because this only contains code and no explanation in text.