I made a script so that a block gets unanchored after you touch it, so it falls down from a tall height, now how do I make it so that it comes back as it is in the same position?
COMMUNITY QUESTION
How do you regenerate a block?
3 answers
Clone it before it's properties are changed then clone the clone into Workspace.
I'm going to use example variables since I don't what the variables of your brick are.
local Position = Origin.Position
Origin = script.Parent
local Lighting = game.GetService('Lighting')
new=Origin:clone
new.Parent = Lighting
local debounce = false
function anchor(v)
if Origin.Anchored = true then
Origin.Anchored = false
end
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil and debounce == false then
debounce = true
debounce = false
end
end
wait(24)
new.Parent = Workspace
new.Position = Position
return
script.Parent.Touched:connect(onTouched)
That should work, but message me if it doesn't.
This might help. http://wiki.roblox.com/index.php?title=Instantiation_of_a_part
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Sorry, I'm a noob at scripting, how do I clone blocks?