Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

BackgroundColor3 is only changing to white and thats it!?!? in the output theres nothing

Asked by 4 years ago
local player = game.Players.LocalPlayer
local playbutton = player.PlayerGui:WaitForChild("startmenugui"):WaitForChild("Frame"):WaitForChild("frameplay"):WaitForChild("Play")
local startmenugui = game.StarterGui:WaitForChild("startmenugui")


playbutton.MouseEnter:Connect(function()
    playbutton.BackgroundColor3 = Color3.new(194, 144, 87)
    playbutton.Position = UDim2.new(0.1, 0,1.225, 0)

    game.StarterGui.SoundFX:WaitForChild("Hoversound"):Play()
end)

playbutton.MouseLeave:Connect(function()
    playbutton.BackgroundColor3 = Color3.new(46, 55, 95)
    playbutton.Position  = UDim2.new(0.37, 0,1.225, 0)

    game.StarterGui.SoundFX:WaitForChild("Hoversound"):Stop()

end)

0
Replace all Color3.new by Color3.FromRBG TheRealPotatoChips 793 — 4y
0
oh we answered in the same time TheRealPotatoChips 793 — 4y
0
not working legendarycoos11 1 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Try this

local player = game.Players.LocalPlayer
local playbutton = player.PlayerGui:WaitForChild("startmenugui"):WaitForChild("Frame"):WaitForChild("frameplay"):WaitForChild("Play")
local startmenugui = game.StarterGui:WaitForChild("startmenugui")


playbutton.MouseEnter:Connect(function()
    playbutton.BackgroundColor3 = Color3.fromRGB(194, 144, 87)
    playbutton.Position = UDim2.new(0.1, 0,1.225, 0)

    game.StarterGui.SoundFX:WaitForChild("Hoversound"):Play()
end)

playbutton.MouseLeave:Connect(function()
    playbutton.BackgroundColor3 = Color3.fromRGB(46, 55, 95)
    playbutton.Position  = UDim2.new(0.37, 0,1.225, 0)

    game.StarterGui.SoundFX:WaitForChild("Hoversound"):Stop()

end)

Ad
Log in to vote
0
Answered by
pwx 1581 Moderation Voter
4 years ago

Change all your Color3.new() to Color3.fromRGB()

You can read up more on Color3 here.

Answer this question