Buttons only work for one person

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)

show the code so people can assist you

showed it, dont particularly think it’s a script problem, making sure though.

when you say only works for 1 person what does that mean? like is the game published and people try to click it and it doesn’t work?

1 Like

When I try to click it in roblox studio, it works but when I try to click it in the published real game, it doesn’t work and sometimes it works for another player

Never mind, the issue is it only works when i’m alone, but when I am with multiple or one extra people it doesn’t work anymore and it is unclickable

Is this on a server script or a client/local script?

It is a local script of course.

Can you provide a screenshot of the explorer view?

Screen Shot 2022-09-27 at 7.40.30 PM
Screen Shot 2022-09-27 at 9.42.31 PM