when I break a block, I need another one to come under it, but I don't know how to do it. I have a team to command the block, I tried to add my command there, and I did not succeed, because I'm only a new player. cloning of the block:
local object = game.Workspace.blocks.Stone1 local ClonedObject = object:clone() ClonedObject.Parent = game.Workspace ClonedObject.Position = Vector3.new(-36.5, 4, 116.4) end
but I tried to add my own, and I,of course, did not work, look, and help me, please, so that in the future I could fix the error myself:
local object = game.Workspace.blocks.Stone1 repeat game.Workspace.blocks.Stone1 = destroy until local ClonedObject = object:clone() ClonedObject.Parent = game.Workspace ClonedObject.Position = Vector3.new(-36.5, 4, 116.4) end
I tried to make the function so that it was executed after the block necessary to me will break, but, alas, I couldn't:(
This is Lua. It's unnecessary to put an end at the end of every script. Here's the script I fixed for you:
local oldobject = workspace.blocks.Stone1 oldobject.Changed:connect(function(property) if property == "Parent" then if not oldobject.Parent then local ClonedObject = oldobject:Clone() ClonedObject.Parent = workspace ClonedObject.Position = Vector3.new(-36.5, 4, 116.4) oldobject = ClonedObject end end end)
By the way, you should learn Lua better.