Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is does this cframe door script error out?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

This script errors out at line 7. Output: Workspace.Door.Script:7: Bad argument #1 to '?' (Vector3 expected, got nil)

part = script.Parent.Part
part2 = script.Parent.Part2
function move()
    for i= 0.1 ,50 do
        wait(0.1)
        b = 0.1+0.1
    part.Position = Position + Vector3.new(0,(b),0) 
    part2.Position = Position + Vector3.new(0,(b),0) 
    end
end

script.Parent.ClickDetector.MouseClick:connect(move)

1 answer

Log in to vote
0
Answered by 9 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

try this

part.Position=part.Position+Vector3.new(0,b,0)
part2.Position = part2.Position+ Vector3.new(0,b,0) 

http://wiki.roblox.com/index.php?title=Vector3 and dont put parentheses around your variable

Ad

Answer this question