MouseButton1Click not working

Oh, that’s why. Im guessing your script makes a clone of the GUI and parents it to the playerGUI. That means you have all this time been interacting with a GUI that the player can’t see.

The solution is to detect the playergui’s version of the gui then

local Player = game.Players.LocalPlayer

Player.PlayerGui:WaitForChild("GuiS"):WaitForChild("TextButton").MouseButton1Click:Connect(function()
	print("Button was clicked!")
	local tween = game:GetService("TweenService"):Create(script.Parent.Parent["Seat"], TweenInfo.new(5), {CFrame = script.Parent["Seat"].CFrame})
	tween:Play()
end)

edit: if your doing this in a server script then detect who’s touching the seat and from there get the player through GetPlayerFromCharacter()

1 Like

Is it a billboardgui by any chance? If so, mouseclick doesn’t register for billboardgui’s unless they’re still parented to the playergui.

1 Like

No, it doesn’t seem like notmo gives any hints that it’s a billboardgui. Although you are correct if that was the case.

1 Like

Although did it work? reply if so notmo12345

1 Like

I am so dumb. I just wake up and mousebutton1click doesn’t work in normal scripts.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.