When Im using MouseButton1Click its not working

Full script:

local Menu = game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain
local MenuButton =  game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton

MenuButton.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton:TweenSize(
		UDim2.new(0.449, 0,2.306, 0),
		"Out",
		"Quad",
		.1,
		true
	)
end)

MenuButton.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton:TweenSize(
		UDim2.new(0.385, 0,1.977, 0),
		"Out",
		"Quad",
		.1,
		true
	)
end)

local PhoneIsOpen = false

MenuButton.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseClick:Play()
	if PhoneIsOpen == false then
		PhoneIsOpen = true	
		if game:GetService("UserInputService").TouchEnabled == false then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.09, 0,0.72, 0),
				"Out",
				"Quad",
				.2,
				true
			)	
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(-0.27, 0,0.975, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
		if game:GetService("UserInputService").TouchEnabled == true then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.15, 0,0.55, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(-0.4, 0,0.495, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
	else
		PhoneIsOpen = false
		if game:GetService("UserInputService").TouchEnabled == false then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.09, 0,9, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(0.005, 0,0.975, 0),
				"Out",
				"Quad",
				.2,
				true
			)	

		end
		if game:GetService("UserInputService").TouchEnabled == true then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.15, 0,1.7, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(0.008, 0,0.495, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
	end
end)

game:GetService("UserInputService").InputBegan:Connect(function(Key)
	if Key.KeyCode == Enum.KeyCode.M then
		if PhoneIsOpen == false then
			PhoneIsOpen = true	
			if game:GetService("UserInputService").TouchEnabled == false then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.09, 0,0.72, 0),
					"Out",
					"Quad",
					.2,
					true
				)	
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(-0.27, 0,0.975, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
			if game:GetService("UserInputService").TouchEnabled == true then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.15, 0,0.55, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(-0.4, 0,0.495, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
		else
			PhoneIsOpen = false
			if game:GetService("UserInputService").TouchEnabled == false then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.09, 0,9, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(0.005, 0,0.975, 0),
					"Out",
					"Quad",
					.2,
					true
				)	

			end
			if game:GetService("UserInputService").TouchEnabled == true then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.15, 0,1.7, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(0.008, 0,0.495, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
		end
	end
end)


game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain.ButtonClose.MouseButton1Click:Connect(function()
	PhoneIsOpen = false
	if game:GetService("UserInputService").TouchEnabled == true then
		game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
			UDim2.new(0.15, 0,1.7, 0),
			"Out",
			"Quad",
			.2,
			true
		)
		game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
			UDim2.new(0.008, 0,0.495, 0),
			"Out",
			"Quad",
			.2,
			true
		)
	end
	if game:GetService("UserInputService").TouchEnabled == false then
		game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
			UDim2.new(0.09, 0,9, 0),
			"Out",
			"Quad",
			.2,
			true
		)
		game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
			UDim2.new(0.005, 0,0.975, 0),
			"Out",
			"Quad",
			.2,
			true
		)	

	end
end)
print("Beffore Function")

local Menu = game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain
local Buttons = Menu.Apps.Home.Apps

Buttons.Emotes.Button.MouseButton1Click:Connect(function()
	print('In Function')
end)

local UIbutton = Buttons.Cash.Button

function name()
	print("WORKED")
end

UIbutton.MouseButton1Click:Connect(name)

print("After function")
Buttons.Cash.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Cash.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Cash.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Cash.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Codes.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Codes.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Codes.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Codes.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Emotes.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Emotes.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Emotes.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Emotes.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Modes.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Modes.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Modes.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Modes.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Rewards.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Rewards.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Rewards.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Rewards.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Settings.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Settings.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Settings.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Settings.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Shop.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Shop.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Shop.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Shop.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.SpawnVehicles.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.SpawnVehicles.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.SpawnVehicles.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.SpawnVehicles.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

Buttons.Teams.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Teams.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)
Buttons.Teams.Button.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Teams.Button:TweenSize(
		UDim2.new(1, 0,1, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

wait, did you repeat the script from start???


afk,i will help you later

i 'm back, any updates?
Tell me, and i will try to solve this more spacious

I have tryed some different ways of doing this, but still nothing.

Try using this, you repeated your script over and over…

local Menu = game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain
local MenuButton =  game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton

MenuButton.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton:TweenSize(
		UDim2.new(0.449, 0,2.306, 0),
		"Out",
		"Quad",
		.1,
		true
	)
end)

MenuButton.MouseLeave:Connect(function()
	game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneHUD.Menu.Frame.ImageButton:TweenSize(
		UDim2.new(0.385, 0,1.977, 0),
		"Out",
		"Quad",
		.1,
		true
	)
end)

local PhoneIsOpen = false

MenuButton.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseClick:Play()
	if PhoneIsOpen == false then
		PhoneIsOpen = true	
		if game:GetService("UserInputService").TouchEnabled == false then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.09, 0,0.72, 0),
				"Out",
				"Quad",
				.2,
				true
			)	
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(-0.27, 0,0.975, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
		if game:GetService("UserInputService").TouchEnabled == true then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.15, 0,0.55, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(-0.4, 0,0.495, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
	else
		PhoneIsOpen = false
		if game:GetService("UserInputService").TouchEnabled == false then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.09, 0,9, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(0.005, 0,0.975, 0),
				"Out",
				"Quad",
				.2,
				true
			)	

		end
		if game:GetService("UserInputService").TouchEnabled == true then
			game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
				UDim2.new(0.15, 0,1.7, 0),
				"Out",
				"Quad",
				.2,
				true
			)
			game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
				UDim2.new(0.008, 0,0.495, 0),
				"Out",
				"Quad",
				.2,
				true
			)
		end
	end
end)

game:GetService("UserInputService").InputBegan:Connect(function(Key)
	if Key.KeyCode == Enum.KeyCode.M then
		if PhoneIsOpen == false then
			PhoneIsOpen = true	
			if game:GetService("UserInputService").TouchEnabled == false then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.09, 0,0.72, 0),
					"Out",
					"Quad",
					.2,
					true
				)	
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(-0.27, 0,0.975, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
			if game:GetService("UserInputService").TouchEnabled == true then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.15, 0,0.55, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(-0.4, 0,0.495, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
		else
			PhoneIsOpen = false
			if game:GetService("UserInputService").TouchEnabled == false then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.09, 0,9, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(0.005, 0,0.975, 0),
					"Out",
					"Quad",
					.2,
					true
				)	

			end
			if game:GetService("UserInputService").TouchEnabled == true then
				game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
					UDim2.new(0.15, 0,1.7, 0),
					"Out",
					"Quad",
					.2,
					true
				)
				game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
					UDim2.new(0.008, 0,0.495, 0),
					"Out",
					"Quad",
					.2,
					true
				)
			end
		end
	end
end)


game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain.ButtonClose.MouseButton1Click:Connect(function()
	PhoneIsOpen = false
	if game:GetService("UserInputService").TouchEnabled == true then
		game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
			UDim2.new(0.15, 0,1.7, 0),
			"Out",
			"Quad",
			.2,
			true
		)
		game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
			UDim2.new(0.008, 0,0.495, 0),
			"Out",
			"Quad",
			.2,
			true
		)
	end
	if game:GetService("UserInputService").TouchEnabled == false then
		game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain:TweenPosition(
			UDim2.new(0.09, 0,9, 0),
			"Out",
			"Quad",
			.2,
			true
		)
		game.Players.LocalPlayer.PlayerGui.MainGUI.LeftMain:TweenPosition(
			UDim2.new(0.005, 0,0.975, 0),
			"Out",
			"Quad",
			.2,
			true
		)	

	end
end)
print("Beffore Function")

Try this one too

local Menu = game.Players.LocalPlayer.PlayerGui.MainGUI.PhoneMain
local Buttons = Menu.Apps.Home.Apps

Buttons.Emotes.Button.MouseButton1Click:Connect(function()
	print('In Function')
end)

local UIbutton = Buttons.Cash.Button

function name()
	print("WORKED")
end

UIbutton.MouseButton1Click:Connect(name)

print("After function")
Buttons.Cash.Button.MouseEnter:Connect(function()
	game.Players.LocalPlayer.PlayerGui.Sounds.MouseHover:Play()
	Buttons.Cash.Button:TweenSize(
		UDim2.new(1.2, 0,1.2, 0),
		"Out",
		"Quad",
		.2,
		true
	)	
end)

So is there any updates?
Answer.

Still no output, I’m so confused.

Tell me your purpose for the script, i’'m really confused…
Do you make sure that the script is enabled? (Disable bool is false, Enable bool is true)

Its all enabled, the script controllers the phone in my game, and everything else in the script works

image
what do you mean with else?

I also want to say, thank you for helping me

wait, is your problem solved now? just to making sure…

All the code at the bottom used to resize the buttons in the phone when the mouse enters them. No its not solved, I was just saying thank you

Where it means, you don’t need the examples like

Buttons.Emotes.Button.MouseButton1Click:Connect(function()
	print('In Function')
end)

local UIbutton = Buttons.Cash.Button

function name()
	print("WORKED")
end

If you want to make sure the hover function worked, just put print(“lalala”) inside the function

I know the hover functions work, its just not detecting a click

remove this script

Buttons.Emotes.Button.MouseButton1Click:Connect(function()
	print('In Function')
end)

local UIbutton = Buttons.Cash.Button

function name()
	print("WORKED")
end

All i mean is, try creating a function that uses click to be called. then call it using MouseButton1Click event.

after using

local function Click()
	print("WORKED")
end

Buttons.Cash.Button.MouseButton1Click:Connect(function(Click)

Still nothing

Try using kick method to test it out

local function Click()
	game.Players.LocalPlayer:Kick("TESTHAHAHAHA")
end

Buttons.Cash.Button.MouseButton1Click:Connect(function(Click)