Hello! I'm making a minecraft tool wich allows you to place blocks and i tried to replicate the WorldEdit plugin. Now, i have //undo, //up, //cut and //paste done. Since there is a //set command to fill an area with the block given i want to make it. Now the problem is that i don't know how i can do this. I searched it and there's nothing about it. My question is, how can i fill an area with 2 given positions? Something like Region3. Also, sorry for not providing code, but i don't know where to start from.
I don't know if this is the best solution, but I recommend just quickly looping through the positions creating blocks.
local Pos1 = script.Parent.OneCorner.Position --Switch for your pos1 local Pos2 = script.Parent.OtherCorner.Position --Switch for your pos1 local BlockSize = 4 for x = (Pos1.X/BlockSize), (Pos2.X/BlockSize) do for y = (Pos1.Y/BlockSize), (Pos2.Y/BlockSize) do for z = (Pos1.Z/BlockSize), (Pos2.Z/BlockSize) do local NewBlock = Instance.new("Part") NewBlock.Anchored = true NewBlock.Size = Vector3.new(BlockSize , BlockSize , BlockSize ) NewBlock.Position = Vector3.new(x*BlockSize , y*BlockSize , z*BlockSize ) NewBlock.Parent = game.Workspace end end end