How do I make an SCP-087 endless staircase script out of this?

I made a script for my SCP-087 endless staircase game but I cannot figure out why it isn’t working which I’m trying to make it clone whenever you touch a certain brick (cloner).

Unfortunately though, I cannot find any solutions to my problem on the website or any other websites. And here is something to note, I am a basic scripter and a detailed builder.

local model = game.Workspace.Staircase
local part = model.Cloner
local copy = model:Clone()

	part.Touched:Connect(function(hit)
	while true do
		copy:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.new(0,14.3,0))
		wait(0.005)
		script.Disabled = true
	end
end)

Don’t disable the script, just disconnect the connection.

1 Like
local model = game.Workspace.Staircase
local part = model.Cloner
local copy = model:Clone()
local generated = false
	part.Touched:Connect(function(hit)
if not generated then
generated = true
	for i = 1,(put how much layers of stairz do u want) do
print("generated cool gamer stair")
		copy:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.new(0,-4,0))
		wait(0.005)
	end
end
end)
1 Like

It still isn’t working, I tweaked a little bit of your script (down below) that you have shown me and it still isn’t working. I also want the cloner to be cloned as well with the model so you can continue going down the stairs forever.

local model = script.Parent.Parent
local part = model.Cloner
local copy = model:Clone()
local generated = false

part.Touched:Connect(function(hit)
	if not generated then
		generated = true
		for i = 1,(1) do
			print("Generated Staircase Floor..")
			copy:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.new(0,-14.3,0))
			wait(0.005)
		end
	end
end)
local model = script.Parent.Parent
local part = model.Cloner
local generated = false

part.Touched:Connect(function(hit)
	if not generated then
		generated = true
			print("Generated Staircase Floor..")
			wait(0.005)
local copy = model:Clone()
copy.Parent = (put any endless stair folder or smth here)
copy.Name = model.Name.."clone"
copy:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.new(0,-14.3,0))
print("success!")
wait(0.01)
script:Destroy() --stop cloning now!
	end
end)
1 Like

if the script doesnt work remove script:Destroy()

2 Likes