This script is buggy, and when I put my mouse off of it, it glitches sometimes and doesnt tween it back to 0, where the x value is originally as the frame. I'd like to know if there's another function of some sort that sets it back to its original position.
JediFrame = script.Parent.Parent.Parent DescFrame = JediFrame.Desc script.Parent.MouseEnter:connect(function() script.Parent:TweenSizeAndPosition(UDim2.new( 0, 253, 0, 30), UDim2.new( 0, 0, 0, 30), "Out", "Elastic", 0.3) DescFrame:TweenSizeAndPosition(UDim2.new( 0, 150, 0, 280), UDim2.new( 0, -150, 0, 20), "Out", "Elastic", 0.5) end)
Here's the glitch
script.Parent.MouseLeave:connect(function() script.Parent:TweenSizeAndPosition(UDim2.new( 0, 0, 0, 30), UDim2.new( 0, 0, 0, 30), "Out", "Elastic", 0.3) DescFrame:TweenSizeAndPosition(UDim2.new( 0, 150, 0, 277), UDim2.new( 0, -150, 0, 20), "Out", "Elastic", 0.5) end)
You are probably leaving it before the tween can finish. Add true to the end of the function calls to allow the functions to override each other. Like this.
JediFrame = script.Parent.Parent.Parent DescFrame = JediFrame.Desc script.Parent.MouseEnter:connect(function() script.Parent:TweenSizeAndPosition(UDim2.new( 0, 253, 0, 30), UDim2.new( 0, 0, 0, 30), "Out", "Elastic", 0.3, true) DescFrame:TweenSizeAndPosition(UDim2.new( 0, 150, 0, 280), UDim2.new( 0, -150, 0, 20), "Out", "Elastic", 0.5, true) end)
and
script.Parent.MouseLeave:connect(function() script.Parent:TweenSizeAndPosition(UDim2.new( 0, 0, 0, 30), UDim2.new( 0, 0, 0, 30), "Out", "Elastic", 0.3, true) DescFrame:TweenSizeAndPosition(UDim2.new( 0, 150, 0, 277), UDim2.new( 0, -150, 0, 20), "Out", "Elastic", 0.5, true) end)
Hope that helps ^-^