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)