Simple Problem with TweenService

Hi everyone, I made a gamepass which I’m selling in game. I’m trying to make a screen drop down once someone purchased the gamepass, although it wont tween it, saying: “Line 13: Unable to cast Double UDim2”. Here is the script. Please help, thank you!


local MPS = game:GetService("MarketplaceService")
local GamepassID = 13905751

script.Parent.MouseButton1Click:Connect(function()
	MPS:PromptGamePassPurchase(player, GamepassID)
end)

MPS.PromptGamePassPurchaseFinished:Connect(function(player, GamepassID, isPurchased)
	print("PromptGamePassPurchaseFinished fired.")
	if isPurchased then
		script.Parent.Parent.Parent.Parent.Rejoin.Frame:TweenPosition(0.346, 0,0.087, 0)
		wait(5)
		script.Parent.Parent.Parent.Parent.Rejoin.Frame:TweenPosition(0.346, 0,-0.087, 0)
	end
end)

Change “0.346, 0,0.087, 0” to “UDim2.new(0.346, 0,0.087, 0)”
And likewise change “0.346, 0,-0.087, 0” to “UDim2.new(0.346, 0,-0.087, 0)”

2 Likes