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

create parts around a block?

Asked by 6 years ago

I'm doing a mining game, and to create a rock I created this script

local lock = script.Parent.LockStone
local Yp = 0
local a = 0

while true do
    wait(0.01)
    if a < 20 then 
        if script.Parent:IsDescendantOf(workspace) then
    local stone = game.ReplicatedStorage.parts.Stone1:Clone()
    stone.Name = "Stone"
    stone.Parent = lock.Parent
    stone.CFrame = CFrame.new(lock.Position.x-math.random()-math.random(), lock.Position.y+Yp, lock.Position.x-math.random()-math.random())*CFrame.fromEulerAnglesXYZ(0,math.random(),0)
    Yp = Yp + 0.08
    a = a + 1
    lock.Transparency = 1
        end
        end
end

but the stone forms on the same straight "X" as LockStone but the "Z" position always decreases or increases

Answer this question