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

Can anyone help me make this brick regen after being touched?

I made a brick named "FF" that contained the script to move Engine and Wing1. I want to make the "FF" brick regenerate after 5 seconds, after being touched. Sorry for not specifically telling you guys.

Engine = script.Parent.Parent.Engine
Wing1 = script.Parent.Parent.Wing1

function onTouched(hit)
    local human = hit.Parent:findFirstChild("Humanoid")
     if (human ~= nil) then
         for loop = 1, 100 do
    Engine.CFrame = Engine. CFrame *CFrame.new(0, 0, -.1) -- z makes it move forwad
     wait(1/25)
     Wing1.CFrame = Wing1.CFrame *CFrame.new(0, 0, .1)
     wait(1/25)

         end
     end
 end
     script.Parent.Touched:connect(onTouched)

1 comment

0

I see a wing and an engine moving forward, but what part are you trying to regenerate? What exactly do you mean by "regenerate"?

1 answer

Hmm if it contains a script then I wander...

  • Put your script in workspace
Engine = script.Parent.Engine
Wing1 = script.Parent.Wing1
Backup = script.Parent.FF -- this is the brick
	 
function onTouched(hit)
	local human = hit.Parent:findFirstChild("Humanoid")
  	     if (human ~= nil) then
 	         for loop = 1, 100 do
 	    Engine.CFrame = Engine. CFrame *CFrame.new(0, 0, -.1) -- z makes it move forwad
 	     wait(1/25)
 	     Wing1.CFrame = Wing1.CFrame *CFrame.new(0, 0, .1)
 	     wait(1/25)
 	 
           end
 	     end
			wait(5)
			Backup.Clone().Parent = Workspace
			Backup.Destroy()
			
 	 end
 	     script.Parent.Touched:connect(onTouched)

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