Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a regeneration brick in roblox studio?

So I’ve been working on a script for a regeneration brick (when a brick is clicked it spawns a brick) in a specific location (e.g. -21, 3, 0) and it spawns there for a few seconds and then disappears, but I want it to regenerate so other people can use it as well. My code that I have been scripting dosen't work in any way shape or form, any ideas?

4 comments

0

help

0

What do you mean reuse?

0

So it spawns in, and after 7 seconds, it disappears. I want to make it so players have the option ONLY when the brick has dissapeared, and it regenerates when a certain brick is touched. (The brick I want to regenerate is a smooth sphere ball, and the brick I want to activate the script to regenerate a new sphere ball is a standard smooth brick)

0

Please paste you current code so I can have an understanding of your goal

2 answers

✓ Accepted answer
local Debris = game:GetService("Debris")
local Brick = workspace.Brick

Brick.ClickDetector.MouseClick:Connect(function(PlayerClicked)
	local VectorPoint3 = Vector3.new(-21, 3, 0)
	local BrickClone = Brick:Clone(); BrickClone.Position = VectorPoint3
	Debris:AddItem(BrickClone, 3)
end)

2 comments

0

DerbisService and Derbis is getting errors, did you mean DebrisService and Debris?

0

Which lines, and what are the errors?

Fixed script from above from Fehren (Please accept feahren for this answer)

local DebrisService = game:GetService("Debris")
local Brick = workspace.Brick

Brick.ClickDetector.MouseClick:Connect(function(PlayerClicked)
    local VectorPoint3 = Vector3.new(-21, 3, 0)
    local BrickClone = Brick:Clone(); BrickClone.Position = VectorPoint3
    DebrisService:AddItem(BrickClone, 3)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.