Fandom

ROBLOX Wikia

Regens

12,580pages on
this wiki
Add New Page
Comments0 Share
Regenbutton

A typical Regeneration button

Regeneration (also known as regen) in ROBLOX means a script or button that makes a model regenerate or disappear and re-appear.

The Script

The regeneration script by ROBLOX is as follows:

model = game.Workspace.MyModelName
messageText = "Regenerating MyModelName..."

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()

while true do
	wait(300) 

	message.Parent = game.Workspace
	model:remove()

	wait(4) 

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

The script above tells the computer to find the model "MyModelName" and regenerate it every 300 seconds, while printing a message on the screen saying "Regenerating MyModelName" for 4 seconds.

model = game.Workspace.MyModelName
messageText = "Regenerating MyModelName..."
while true do
	wait(300) 

	message.Parent = game.Workspace
	model:remove()

This part tells the computer that every 300 seconds, if true, to remove the selected model.

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

This part tells the computer to replace the recently removed model.

Regeneration Buttons

Regeneration buttons are usually bright purple coloured buttons that are placed next to the selected model to regenerate.

model = game.Workspace.MyModelName -- Replace with your model name
messageText = "Regenerating MyModelName..."

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true

function regenerate()
	message.Parent = game.Workspace
	model:remove()

	wait(4) -- display regen message for 4 seconds

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

	enabled = false
	wait(30)
	enabled = true
end

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

script.Parent.Touched:connect(onHit)

The script above is the regenerate button script. It combines the common regenerate script with a OnTouch function.

Start a Discussion Discussions about Regens

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.