model=script.Parent.Parent backup=model:clone()enabled=true function regenerate()model:remove()wait(.3)model=backup:clone()model.Parent=game.Workspace model:makeJoints()script.Disabled=true script.Parent.BrickColor=BrickColor.new(26)wait(.3)script.Parent.BrickColor=BrickColor.new(104)script.Disabled=false end function onHit(S)if S.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")~=nil and enabled then regenerate()end end script.Parent.Touched:connect(onHit)
--To make the button work, group this with anything you want to be regened. this works with all models,
--You just have to group it with them. anything, bricks, anything.

model = script.Parent.Parent

backup = model:clone()
enabled = true

function regenerate()
	model:remove()

	wait(0.3) --how many seconds it takes to regen

	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()

	script.Disabled = true
	script.Parent.BrickColor = BrickColor.new(26) --basically black... (it go's black when you regen it
	wait(0.3) --how much sec it takes to regen
	script.Parent.BrickColor = BrickColor.new(104) --purple (just a purple brick (exept it regen)
	script.Disabled = false
end

function onHit(hit)
	if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then --if a humanoid touches it then...
		regenerate()
	end
end

script.Parent.Touched:connect(onHit)
