I made an Image button UI that prompts you to buy a place, but it only works for one person and no one else. I don’t think it’s because of the script I have for it, because all I use it MouseButton1 (and it works)
local btn = script.Parent
local isHovering = false
local deb = false
btn.MouseEnter:Connect(function()
isHovering = true
btn:TweenSize(UDim2.new(0.281, 0, 0.280, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
if not deb then
deb = true
script.Parent.ui_hover_ugd:Play()
deb = false
end
end)
btn.MouseLeave:Connect(function()
isHovering = false
btn:TweenSize(UDim2.new(0.172, 0,0.232, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
btn.MouseButton1Down:Connect(function()
btn:TweenSize(UDim2.new(0.265, 0, 0.300, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
btn.MouseButton1Up:Connect(function()
if not isHovering then
btn:TweenSize(UDim2.new(0.172, 0, 0.232, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
else
btn:TweenSize(UDim2.new(0.265, 0, 0.250, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end
end)