So i’m trying to make a baseplate with the Roblox classic house cloning infinitely across the baseplate.
Problem is I have no clue what i am doing and i have gotten to this:
--forever generation
local original = game.ReplicatedStorage["Classic House"]
local int = 5
while true do
local value = int + 5
local number = CFrame.new(value,value,value)
local copy = original:Clone()
copy.Parent = game.Workspace
copy:PivotTo(number)
wait()
end
I’m more of a c++ guy so i was planning on doing a simple var++ but that’s not (to my understanding) in lua.
How can i go about making this work?
This will hang the thread forever until the script time exhausts. Try giving this a limit, or at least an amount of time to wait between iterations.
Something like:
local original = game:GetService("ReplicatedStorage"):WaitForChild("Classic House")
local int = 5
while true do
local clone = original:Clone()
clone.Parent = workspace
clone:SetPrimaryPartCFrame(CFrame.new(int, int, int))
int += 5
task.wait(1)
end
This will wait a second before making a new clone at (5,5,5), (10,10,10), … which might not be the end result you’re after, since it will create a line through the sky and not a grid of houses like I think you might be after.