robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 29 Jul 2012 03:40 PM |
Let's say i have 2 bricks, from a distance of #.
How would i make it so when u press a GUI button the brick #1 "fires" a brick and to the brick #2?
Like a gun script.
Will this work?
function onClick() battl3 = script.Parent.Parent.Parent.Parent.Battle.Value Shooter1 = game.Workspace.battl3.Model1.Shooter Shooter2 = game.Workspace.battl3.Model2.Shooter brick = Instance.new("Part", Shooter1) brick.Size = Vector3.new(3,3,3) brick.Shape = "Sphere" brick.Position = Shooter1.Position + Vector3.new(0,0,5) brick.CanCollide = false brick.Anchored = true wait() for i=1, 12, 1 do brick.CFrame = brick.CFrame + CFrame.new(0,0,1) end end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 29 Jul 2012 03:45 PM |
Fix:
function onClick() battl3 = script.Parent.Parent.Parent.Parent.Battle.Value Shooter1 = game.Workspace.battl3.Model1.Shooter Shooter2 = game.Workspace.battl3.Model2.Shooter brick = Instance.new("Part", Shooter1) brick.Size = Vector3.new(3,3,3) brick.Shape = "Sphere" brick.Position = Shooter1.Position + Vector3.new(0,0,5) brick.CanCollide = false brick.Anchored = true wait() for i=1, 12, 1 do brick.CFrame = brick.CFrame + CFrame.new(0,0,1) if i==12 then brick:remove() end end end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 29 Jul 2012 03:57 PM |
Fix2:
function onClick() battl3 = script.Parent.Parent.Parent.Parent.Battle.Value Shooter1 = game.Workspace.battl3.Model1.Shooter Shooter2 = game.Workspace.battl3.Model2.Shooter brick = Instance.new("Part", Shooter1) brick.Size = Vector3.new(3,3,3) brick.Shape = "Sphere" brick.Position = Shooter1.Position + Vector3.new(0,0,2) brick.CanCollide = false brick.Anchored = true script.Parent.Parent.Parent.Parent.PP.Value = script.Parent.Parent.Parent.Parent.PP.Value - 5 script.Boom:clone().Parent = brick wait() for i=1, 12, 1 do brick.CFrame = brick.CFrame + CFrame.new(0,0,2) end end end script.Parent.MouseButton1Click:connect(onClick)
Boom script: randomify = math.random(4,6) damage = math.random(30, 50) * script.Parent.Parent.Level.Value / randomify
function onTouch(hit) if hit.Name == "Shooter1" then if hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage omg = Instance.new("Explosion", script.Parent) omg.BlastPressure = 0 wait() script.Parent:remove() end end end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|