I made a keyboard-like model and I'm trying to make it so when you click a key it goes down for 0.2 seconds and then back up, like a keyboard would. The script I made doesn't work, and the output tells me " Workspace.Console.Keys.Union.Script:4: bad argument #2 to '?' (Vector3 expected, got userdata)"
pos = script.Parent.CFrame
function click()
pos = pos + CFrame.new(0, -0.2, 0)
wait(0.2)
pos = pos + CFrame.new(0, 0.2, 0)
end
script.Parent.ClickDetector.MouseClick:connect(click)
Somebody please help?

1 comment
I did this, and the output said " Workspace.Console.Keys.Union.Script:4: bad argument #2 to '?' (Vector3 expected, got userdata)"