I read online that you have to use a remote event but it doesn't work. This script is supposed to make the button clicked turn blue when clicked. It works when filtering enabled is off.
script:
script.RemoteEvent.OnServerEvent:connect(function(player) local gui = player.PlayerGui.ScreenGuimain.ScrollingFrame.ImageButton1 gui.BackgroundColor3 = Color3.new(0,0,255) end end)
local script:
script.Parent.MouseButton1Down:connect(function() script.Parent.Gui1.RemoteEvent:FireServer() end)
Since you are editing a GuiObject
, you don’t need a RemoteEvent
. So just do this code all under a LocalScript
script.Parent.MouseButton1Click:Connect(function() -- Do code here end)