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

How do I make a button enlarge AND change colours when I hover over it?

Hi everyone!

I'm pretty new to scripting and I have a problem. Can you please tell me how to fix it in layman's terms?

Script i tried:

Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()


local InvenButton = game.StarterGui.ScreenGui.Frame.InvenB
local ShopButton = game.StarterGui.ScreenGui.Frame.ShopB
local BuyButton = game.StarterGui.ScreenGui.Frame.BuyB
local SettingsButton = game.StarterGui.ScreenGui.Frame.SettingB

InvenButton.Mouse:connect(function()
	game.StarterGui.ScreenGui.Frame.InvenB:TweenSize(UDim2.new(0, 88, 0, 80))
end)

local B = -- where B is
	
	B.MouseEnter:Connect(function()
	
end)

B.MouseLeave:Connect(function()
	
end)

4 comments

0

have you tried anything

0

yes i edited it

0

reference the playergui instead of startergui

0

what do you mean

1 answer

Change the name of the event from Mouse to MouseEnter

MouseEnter is when the mouse hovers over it, and MouseLeave is for when it stops hovering.

InvenButton.MouseEnter:connect(function()
	game.StarterGui.ScreenGui.Frame.InvenB:TweenSize(UDim2.new(0, 88, 0, 80))
end)

3 comments

0

that still won't work. you need to reference the playergui for it to appear on the client.

0

it will work but you just wont see it nor get errors. lmao. but yeah use player gui

0

what is plr gui

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