You can write your topic however you want, but you need to answer these questions:
-
What do I want to achieve?
I want to make the button change color when the page finishes moving. -
What is the issue?
For some reason, the event doesn’t work.
This code is written in local script.
local UIPageLayout = script.Parent.Parent.ScreenBack.UIPageLayout
UIPageLayout.PageEnter:Connect(function(page)
local currentButton = script.Parent:FindFirstChild(page.Name)
if currentButton then
currentButton.BackGroundColor = Color3.fromRGB(99,99,99)
end
end)
UIPageLayout.PageLeave:Connect(function(page)
local currentButton = script.Parent:FindFirstChild(page.Name)
if currentButton then
currentButton.BackGroundColor = Color3.fromRGB(243, 243, 243)
end
end)
P. S.
I debugged the code, the event just doesn’t work, it’s not about checking.