Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Attempting to Create Menu GUI and the script wont run?

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)

3 comments

0

Please edit your code to include a code block by pressing the blue "Lua Button" and placing your code inside the lines.

0

Are you using a Local Script?

0

Yes, its a local script under starter GUI

1 answer

✓ Accepted answer

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.

1 comment

0

The code still is not changing the size even with these changes. It seems like the connect function isn't working

This discussion is preserved as it was. New answers, comments, and votes are closed.