I was just writing a script. Then I got this error, 'Unable to cast string to token.'
Here is my code, The Error was on line 18.
local p = script.Parent.Parent local m = game.Players.LocalPlayer:GetMouse() local db = script.Parent.Parent.value db.Value = "false" m.KeyDown:connect(function(k) k = k:lower() if k == "z" then if (db.Value == "false") then p.Enabled = true local j = script.Parent j:TweenPosition( UDim2.new(1, 0,0.018, 0), "Quad", 2, true ) local db = script.Parent.value db.Value = "true" elseif (db.Value =="true") then local j = script.Parent j:TweenPosition( UDim2.new(0.261, 0,0.476, 0), "In", "Quad", 2, true ) p.Enabled = false db.Value = "false" end end end)
Any help would be greatly appreciated,
-Geo
You forgot to add an easingdirection to the tween.
j:TweenPosition( UDim2.new(1, 0,0.018, 0), "Out", --Or In/InOut if you want "Quad", 2, true )