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

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

Asked by
boootzi -7
3 years ago
Edited by JesseSong 3 years ago

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)
0
have you tried anything kepiblop 124 — 3y
0
yes i edited it boootzi -7 — 3y
0
reference the playergui instead of startergui JesseSong 3916 — 3y
0
what do you mean boootzi -7 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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)
0
that still won't work. you need to reference the playergui for it to appear on the client. JesseSong 3916 — 3y
0
it will work but you just wont see it nor get errors. lmao. but yeah use player gui greatneil80 2647 — 3y
0
what is plr gui boootzi -7 — 3y
Ad

Answer this question