Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to cast bool to token. While making tween gui any fixes?

So I tried making a tweenService Gui and I got this. "Unable to cast bool to token" this is the code:

local gui = script.Parent
local MaD = gui.Frame.MaD
local FP = gui.Frame.FP
local CD = gui.Frame.CD
local menuFrame = gui.Frame
local opened = false


gui.Open.MouseButton1Click:Connect(function()
		if opened == false then
		gui.Open.Text = "Close"
		gui.Frame:TweenSizeAndPosition(
		UDim2.new(0.381, 0, 0.231, 0),
		"Out", 
		"Sine", -- Style
		false,
		nil -- The line roblox gives me an error at.
		
		
		
		)
		
		
		
		                 
	
		end
		
end)

Are there any fixes to this problem?

1 comment

0

Any errors. If not try printing the scripts that dont work.

2 answers

✓ Accepted answer
gui.Frame:TweenSizeAndPosition(
        UDim2.new(0.381, 0, 0.231, 0), -- end size
		UDim2.new(0.381, 0, 0.231, 0), -- end position
        "Out", 
        "Sine", -- Style
		0,--Time taken for tween to happen
        false--overide any tween
   )

I think you've messed up the parameter's order. You can find their order here

This discussion is preserved as it was. New answers, comments, and votes are closed.