Button animation not playing

Hi!

I have a simple button script that does not work, and I cant find the issue, because there’s no errors.

Video:


Code:

local mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.MouseButton1Down:Connect(function()
	if script.Parent.Parent.Visible == true then
		SoundClick:Play()
		local new = Instance.new("ImageLabel")
		new.ClipsDescendants = true
		new.Size = UDim2.new(0,0,0,0)
		new.Parent = script.Parent
		new.Image = "rbxassetid://4820210709" -- i will find something
		new.ImageTransparency = 0.7
		new.BackgroundTransparency = 1
		new.Position = UDim2.new(0, mouse.X - 5, 0, mouse.Y + 38) 
		print(mouse.X..mouse.Y)
		print(UDim2.new(0, mouse.X - 5, 0, mouse.Y + 38) )
		new.ImageColor3 = Color3.fromHSV(0, 0, 0)
		new:TweenSize(UDim2.new(0.125, 0, .211, 0), "Out", "Quad", .5, true)
		task.wait(.5)
		for i = 1, 300 do
			new.ImageTransparency -= 0.001
			task.wait(0.001)
		end
	end
end)

Thanks!

1 Like

okay so looking at your video, the ImageLabels do seem to be parented, it even prints the items, im guessing its the tweens that arent working? what exaclty are you trying to achive here?