When I run one of my scripts, I get this error in the output: "Workspace.BridgeDeck.Bridge.Science/Engineering.Part.Script:13: bad argument #1 to '?' (Vector3 expected, got nil)"
Line 13 of said script is as follows: p.CFrame = p.CFrame + Vector3.new(0,0,10)
Does anyone know why this won't work?
[EDIT] The whole script:
function separate()
if game.Workspace:FindFirstChild("Stardrive")== nil then
script.Parent.Sound.Pitch = 1
script.Parent.Sound:play()
wait(3)
local s = game.ServerStorage.Stardrive:clone()
s.Parent = game.Workspace
game.Workspace.Separated.Value = true
wait(0.5)
local p = game.Workspace.Stardrive:GetChildren()
for i = 1,#p do
repeat
p.CFrame = p.CFrame + Vector3.new(0, 0, 10)
wait(0.5)
until
game.Workspace.Stardrive.Shape.Positon.Z <= 868.946
end
else
if game.Workspace:FindFirstChild("Stardrive")~= nil then
script.Parent.Sound.Pitch = -1
script.Parent.Sound:Play()
game.Workspace.Separated.Value = false
game.Workspace.Stardrive:destroy()
end
end
end
script.Parent.ClickDetector.MouseClick:connect(separate)

7 comments
http://wiki.roblox.com/index.php/Lua_errors -- check here for lua errors.
Where is the script located, and what is 'p'?
I tested this to make sure, and it works fine. You sure this is the right line?
I'll give the whole script if you want.
Yea, that'd help. I tested also, and it worked perfectly.
Edited accordingly.
Thanks so much dude, you hit me up to 200 rep :D