Unable to cast double to UDim2 problem

Hi! I’m writing code for a GUI and I am using :tweenposition to help make the UI look smoother, however I get this errorimage
any ideas?

		UDim2.new(0.993, 0,0.412, 0),
			Enum.EasingDirection.Out, 
			Enum.EasingStyle.Bounce,   
			2                                
		)

	script.Parent.Parent.ss:TweenPosition(
		UDim2.new(0.159, 0,-0.399, 0),
		Enum.EasingDirection.In,
		Enum.EasingStyle.Quint,
		2
			
		)

From the error, I am assuming I cannot have 2 tweens in one script?

2 Likes

A double in Lua is a double precision floating point number.

1 Like

Can you show your full script?

1 Like
if player.UserId == '294476650' or '2653480011' or '1145246116' or "196422974" then 
	whitelist.Text = "Welcome, " .. player.Name .. "Welcome to SysTech"
	wait(2)
	script.Parent:TweenPosition(
		UDim2.new(0.993, 0,0.412, 0),
			Enum.EasingDirection.Out, -- Direction of the easing
			Enum.EasingStyle.Bounce,   -- Kind of easing to apply
			2                     -- Duration of the tween in seconds                
		)
	
	
	wait(1)
	script.Parent.Visible = false
	script.Parent.Parent.gui.Visible = true
	script.Parent.Parent.gui:TweenPosition(
		UDim2.new(0.159, 0,-0.399, 0),
		Enum.EasingDirection.In,
		Enum.EasingStyle.Quint,
		2
			
		)
else

	script.Parent.Parent:Destroy()
	end
else
	print'lol'
end
1 Like

Weird, I don’t see anything wrong with it, I just tried it and it works normally. Is it causing anything to break? Is there a line that it’s coming from?

1 Like

I fixed the error, on the top of the page there was a tween without udim2 so I placed it in and it is working, thanks for the help :slight_smile:

2 Likes