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

Need help deleting part of a script?

This script is one i have took and edited is good but is annoying in that whenever you step upon the button a message comes up saying 'regenerating...' i see where it is coming from but whenever i delete part of it it brakes the button so it cannot work. Can someone help me. (sorry about the code block its broken for some reason)

http://www.roblox.com/script-item?id=282966856

1 answer

✓ Accepted answer

To make things simple or you, I'll give you my script where I've removed the messsage part.

local backup = model:clone()
local regenerating = false

function regenerate()
	--Don't regenerate again if we're already doing it!
	if regenerating then
		return
	else
		regenerating = true
	end

	model:Destroy()


	-- Put the copied model back into workspace
	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()

	-- After 30 seconds, allow the model to be regenerated again
	wait(30)
	regenerating = false
end

--Connect a function that regenerates the model when a player touches the button
script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then

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