Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by
Yeevivor4 155
10 years ago

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)
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"? AxeOfMen 434 — 10y

1 answer

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
10 years ago

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)
Ad

Answer this question