hi, i wanna make a highlight so that if you hovering on any gui its will highlight the gui with some animation because, why not but its got bugged like in these video
workspace:
that red thing i highlight is the highlight frame
code:
local monitormodule = require(game.ReplicatedStorage.shop.monitor.monitor)
local clicksound = game.ReplicatedStorage.sound.click
local player = game.Players.LocalPlayer
local hover = game.ReplicatedStorage.sound.hover
local normalsize = script.Parent.agedmonitor.Size
local normalposition = script.Parent.agedmonitor.Position
local player = game.Players.LocalPlayer
local highlightgui = script.Parent.Parent.Frame
function click(imagebutton : ImageButton)
rightscreeninfo.Image = imagebutton.Image
rightscreeninfo.info.Text = "Increase FPS/s by "..monitormodule["active"][imagebutton.Name].." (ACTIVE)"
rightscreeninfo.info2.Text = "Increase FPS/s by "..monitormodule["pasive"][imagebutton.Name].." (PASSIVE)"
script.RemoteEvent:FireServer(imagebutton)
clicksound:Play()
task.wait(0.1)
end
function mouseenter(imagebutton, size)
local hightlightposition = highlightgui.Position
imagebutton:TweenSize(normalsize - UDim2.new(0.01, 0.01, 0.01, 0.01), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
imagebutton:TweenPosition(normalposition + UDim2.new(0.005, 0.005, 0.005, 0.005), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
hover:Play()
highlightgui:TweenPosition(UDim2.new(imagebutton.Position, imagebutton.AbsolutePosition.X, imagebutton.Position, imagebutton.AbsolutePosition.Y))
imagebutton.MouseLeave:Connect(function()
task.wait(0.1)
imagebutton:TweenSize(normalsize, Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
imagebutton:TweenPosition(normalposition, Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
wait(0.5)
highlightgui:TweenPosition(hightlightposition, nil, nil, 0.5)
end)
end
for _, imagebutton : ImageButton in pairs(script.Parent:GetChildren()) do
if imagebutton:IsA("ImageButton") then
imagebutton.MouseButton1Click:Connect(function()
click(imagebutton)
end)
local size = imagebutton.Size
imagebutton.MouseEnter:Connect(function()
mouseenter(imagebutton, size)
end)
end
end
thx for anyone, i appreciate all answer
1 post - 1 participant