pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 07 Jul 2015 03:12 PM |
Ok so I got this script to work inside of my cannon setup. -----------------------------------------
local Boom = Instance.new("Part") Boom.Parent = game.Workspace Boom.formFactor = 0 Boom.Shape = 0 Boom.CanCollide = false Boom.BrickColor = BrickColor:White() Boom.Position = position Boom.Transparency = .8 Boom.Size = Vector3.new(5, 1, 5) Boom.Anchored = true Boom.TopSurface = "Smooth" Boom.BottomSurface = "Smooth" wait(0) Boom:Remove()
----------------------------------------- And I want Boom to get this script (below) inside of its generated part when it spawns into the work space from being shot out of the cannon, To make the script below a child of the script made brick above possible? if so hao? ;-; ------------------------------------------
function onTouched(part) if part.Parent:FindFirstChild("Humanoid") ~= nil then part.Parent.Torso:BreakJoints() end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2015 03:13 PM |
| You're removing the part though. Use an explosion perhaps? |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 07 Jul 2015 03:17 PM |
local Boom = Instance.new("Part") local Bang = script.Bang:Clone() Bang.Parent = Boom Boom.Parent = game.Workspace Boom.formFactor = 0 Boom.Shape = 0 Boom.CanCollide = false Boom.BrickColor = BrickColor:White() Boom.Position = position Boom.Transparency = .8 Boom.Size = Vector3.new(5, 1, 5) Boom.Anchored = true Boom.TopSurface = "Smooth" Boom.BottomSurface = "Smooth" wait(0) Boom:Remove()
Use that instead, but put the script below (the one that kills) as a child of this script, and name it "Bang". |
|
|
| Report Abuse |
|
|
pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 07 Jul 2015 03:17 PM |
I cannot mix explosions as the cause of death for this scenario.
My situation before was.
The cannon ray cast has just enough (roblox)explosion power to kill a player but not destroy parts on other tanks "Because I am using an heath system for tank damage/HP"
However after a few days of testing I found that some of my light tank designs can be torn apart and cause lag when the 40 tiny unions on their front mantles fall onto the baseplate as LAG inducing debris.
So I decided to have a part be able to kill players instead, More efficient, less messy. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 07 Jul 2015 03:18 PM |
| and hopefully that'll fire the touched event with the little time it's been given |
|
|
| Report Abuse |
|
|
pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 07 Jul 2015 03:31 PM |
Only reason it gets 0 time to do the script is because wouldn't that lock up the rest of the script?
This is just a excerpt for the guns properties that is in my tanks main script. |
|
|
| Report Abuse |
|
|
pawnz
|
  |
| Joined: 22 Feb 2010 |
| Total Posts: 286 |
|
|
| 07 Jul 2015 03:32 PM |
| And also how do I make the script become a child of the part? |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 07 Jul 2015 03:34 PM |
Well in the explorer you may see something like: workspace >Part >>Script the part is underneath workspace, which means it's a child of workspace |
|
|
| Report Abuse |
|
|