Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempting to Create Menu GUI and the script wont run?

Asked by 7 years ago
Edited 7 years ago

It is a local Script that is under a screen GUI all under the starter GUI folder.

Player=game.Players.LocalPlayer
Menu=script.Parent
Play=Menu.Play
Spectate=Menu.Spectate

function MouseEnterPlayButton()
    Play.FontSize = "Size 42"
    Play.BackgroundColor3 = Color3.new(0.75, 0.75, 0.75)
    Play.Size = UDim2.new(0.3, 0, 0.2, 0)
end

function MouseLeftPlayButton()
    Play.FontSize = "Size 36"
    Play.BackgroundColor3 = Color3.new(0.6, 0.6, 0.6)
    Play.Size = UDim2.new(0.26, 0, .15, 0)

end

Play.MouseLeave:connect(MouseLeftPlayButton)
Play.MouseEnter:connect(MouseEnterPlayButton)
0
Please edit your code to include a code block by pressing the blue "Lua Button" and placing your code inside the lines. User#11440 120 — 7y
0
Are you using a Local Script? User#11440 120 — 7y
0
Yes, its a local script under starter GUI Hdadam01 5 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

You're using "Size 36" instead of "Size36".

You don't need any spaces. Your code should look like this,

--Local Script
Player=game.Players.LocalPlayer
Menu=script.Parent
Play=Menu.Play
Spectate=Menu.Spectate

function MouseEnterPlayButton()
    Play.FontSize = "Size42"--Removed Space
    Play.BackgroundColor3 = Color3.new(0.75, 0.75, 0.75)
    Play.Size = UDim2.new(0.3, 0, 0.2, 0)
end

function MouseLeftPlayButton()
    Play.FontSize = "Size36"--Removed Space
    Play.BackgroundColor3 = Color3.new(0.6, 0.6, 0.6)
    Play.Size = UDim2.new(0.26, 0, .15, 0)

end

Play.MouseLeave:connect(MouseLeftPlayButton)
Play.MouseEnter:connect(MouseEnterPlayButton)

Hope I Helped!

Good Luck!

If I helped, please don't forget to click the accept answer button. It helps a lot.
0
The code still is not changing the size even with these changes. It seems like the connect function isn't working Hdadam01 5 — 7y
Ad

Answer this question