Loading...

How to make a regen button (AUDI80)

11,219 views

Loading...

Loading...

Transcript

The interactive transcript could not be loaded.

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Oct 9, 2010

This tutorial shwos you how to make a regenbutton to regen something in your place. This is the code you need to continiou the tutorial:
model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
messageText = ""--If you want a message to appear upon pressing, type it here.

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

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

wait(0.1)--Change this number to display the regen message as long as you want in seconds.

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

script.Disabled = true
script.Parent.BrickColor = BrickColor.new(26)--Black
wait(5)--Change this number to change the time in between regenerations via the button, in seconds..
script.Parent.BrickColor = BrickColor.new(104)--Purple
script.Disabled = false
end

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

script.Parent.Touched:connect(onHit)

Loading...

When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...