I have this script on Server:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect( function(Player)
local Player = game.Players:WaitForChild(Player.Name)
local PlayerGui = Player:WaitForChild("PlayerGui")
local Gui = PlayerGui:WaitForChild("ScreenGui")
local Frame = Gui:WaitForChild("Frame")
local Img = Frame:WaitForChild("ImageLabel")
Img.MouseEnter:Connect(function()
print('Enter')
end)
Img.MouseLeave:Connect(function()
print('Leave')
end)
--Img.MouseButton1Click:Connect(function()
-- print('click')
--end)
end)
for this Screengui:
When I run it, MouseEnter and MouseLeave work ok.
But if I try MouseButton1Click I get:
MouseButton1Click is not a valid member of ImageLabel “Players.rogeriodec_games.PlayerGui.ScreenGui.Frame.ImageLabel”
If MouseEnter and MouseLeave are working, why not MouseButton1Click, since both are mouse events?