Hey, here’s a little something from my own game for ya!
Just put this in a LocalScript inside of your GUI and it should work
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
coroutine.wrap(function()
for _, btn in pairs(localPlayer:WaitForChild("PlayerGui"):GetDescendants()) do
if btn:IsA("ImageButton") or btn:IsA("TextButton") then
local buttonSizeX = btn.Size.X.Scale
local buttonSizeY = btn.Size.Y.Scale
btn.MouseEnter:Connect(function()
local newSizeX = (buttonSizeX + 0.05) --// Change this to what you like
local newSizeY = (buttonSizeY + 0.05) --// Change this to what you like
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
tweenService:Create(btn, info, {Size = UDim2.new(newSizeX, 0, newSizeY, 0)}):Play()
end)
btn.MouseLeave:Connect(function()
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
tweenService:Create(btn, info, {Size = UDim2.new(buttonSizeX, 0, buttonSizeY, 0)}):Play()
end)
end
end
end)()