So, I want to make it like when you hover over a text button, it expands, if you leave it, it goes back to normal size. Here is a script I'm stuck with, Feel like it should work
here is a repro:
https://imgur.com/a/7iN4X -- Normal, I need to to go bigger when its hovered.
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)
Hey there, MouseEnter()
and MouseLeave
is what you are looking for. Here are some links you can look at
http://wiki.roblox.com/index.php?title=MouseEnter
http://wiki.roblox.com/index.php?title=MouseLeave
To use it, simply define the buttons and then run the function:
local B = -- where B is B.MouseEnter:Connect(function() -- tween big end) B.MouseLeave:Connect(function() --tween small end)
if this helped you in anyway, make sure to upvote and accept answer. If you have a error comment on the answer.
-- Your Orange, BlackOrange3343 -- PS: Good luck
button.MouseEnter:connect(function() button:TweenSize(Udim2.new(big size),"Out","Quad",0.5,true) end) button.MouseLeave:connect(function() button:TweenSize(Udim2.new(small size),"Out","Quad",0.5,true) end)