Hello developers,
I am having a problem figuring out what part of this code is the problem. Could someone help me identify the problem.
Here is the error and the code.
local function AnimateElementIn(Element)
Element:TweenSize(UDim2.new(0, 281, 0, 281),"Out","Linear",0.25,true)
end
local function AnimateElementOut(Element)
Element:TweenSize(UDim2.new(0, 103, 0, 103),"Out","Linear",0.25,true)
end
icon.selected:Connect(function()
local Emote_Folder = gui:FindFirstChild("Wheel"):WaitForChild("Emotes")
for _,Frame in pairs(Emote_Folder:GetChildren()) do
local TweenInfo = TweenInfo.new(
0.25, -- time to tween
Enum.EasingStyle.Linear, -- easing style
Enum.EasingDirection.Out, -- easing direction
0, -- number of times to repeat
false, -- should it repeat
0.25 -- delay between each tween
)
Frame.MouseEnter:Connect(function()
local tween = TweenService:Create(Frame:WaitForChild("Wheel_Image"), TweenInfo, {ImageTransparency = 0.25})
tween:Play()
for Key,Element in pairs(Emote_Folder:GetChildren()) do
if tonumber(Key:sub(#Key)) > tonumber(Frame.Name:sub(#Frame.Name)) then
AnimateElementIn(Element)
end
end
end)
Frame.MouseLeave:Connect(function()
local tween = TweenService:Create(Frame:WaitForChild("Wheel_Image"), TweenInfo, {ImageTransparency = 0.5})
tween:Play()
for Key,Element in pairs(Emote_Folder:GetChildren()) do
if tonumber(Key:sub(#Key)) > tonumber(Frame.Name:sub(#Frame.Name)) then
AnimateElementOut(Element)
end
end
end)
end
end)