【发布时间】:2020-10-17 19:03:49
【问题描述】:
我不知道这里发生了什么。我正在尝试将随机生成的地形作为测试,此代码是我的实验之一(稍后我将添加曲率代码),但它说“尝试使用“位置”索引 nil”并且我不知道如何修复它。
local Block = game.ReplicatedStorage.Auto_generated
local Plosition = 1
local Line = 1
local Lite = 1
print('1')
Block.Position = Vector3.new(251,35,261)
BlockClone.Position = Vector3.new(Line,pos,Lite)
while Plosition <= 100 do
print('2')
BlockClone = Block:Clone()
BlockClone.Parent = game.Workspace
pos = math.random(0,10)
BlockClone.Position = Vector3.new(Line,pos,Lite)
Line = Line + 10
Plosition = Plosition + 1
if Line == 10 then
Lite = Lite + 10
print('3')
end
if Line == 20 then
Lite = Lite + 10
end
if Line == 30 then
Lite = Lite + 10
end
if Line == 40 then
Lite = Lite + 10
end
if Line == 50 then
Lite = Lite + 10
end
if Line == 60 then
Lite = Lite + 10
end
if Line == 70 then
Lite = Lite + 10
end
if Line == 80 then
Lite = Lite + 10
end
if Line == 90 then
Lite = Lite + 10
end
wait(1)
end
【问题讨论】:
标签: error-handling lua roblox