lkbirds
|
  |
| Joined: 23 Sep 2010 |
| Total Posts: 1301 |
|
|
| 18 Jan 2013 06:40 PM |
Ok I worked and worked on this problem but I have now idea what is causing this. The function just doesnt run there isn't even an error in the output. It's supposed to exploed then make a blackhole like my old script.
unction boom(v1,v2) ex = Instance.New("Explosion") ex.Position = script.Parent.Position ex.BlastRadius = 120 ex.BlastPressure = 500 ex.Parent = game.Workspace wait(0.5) end
local n = 0 while true do if n < #childList then n = n + 1 if n % 800 == 0 then wait() end else n = 1 wait() end
local child = childList[n] if (child ~= hole) and (child.className == "Nuclius") and (child.Anchored == false) then local relPos = hole.Position - child.Position local motivator = child:FindFirstChild("BlackHole Influence") if relPos.magnitude * 240 * massConstant < mass then child.RotVelocity = cross(child.CFrame.lookVector, relPos) * 5 / relPos.magnitude child:BreakJoints() if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then mass = mass + child:GetMass() child:Remove() table.remove(childList, n) n = n - 1 -- This is the reason I need a counter of my own design else child.CanCollide = false -- I can assume that the child will not escape the black hole. if motivator == nil then motivator = Instance.new("BodyPosition") motivator.Parent = child motivator.Name = "BlackHole Influence" end motivator.position = hole.Position motivator.maxForce = Vector3.new(100, 100, 100) * mass * child:GetMass() / (relPos.magnitude * massConstant) end elseif motivator ~= nil then motivator:Remove() end script.Parent.Parent:remove() end end
script.Parent.Parent.Button.ClickDetector.MouseClick:connect(boom)
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2013 06:42 PM |
if n < #childList then
childList is never defined.
|
|
|
| Report Abuse |
|
|
lkbirds
|
  |
| Joined: 23 Sep 2010 |
| Total Posts: 1301 |
|
|
| 18 Jan 2013 06:43 PM |
| This is just a chunk of the code. It's defined in the full version. |
|
|
| Report Abuse |
|
|
lkbirds
|
  |
| Joined: 23 Sep 2010 |
| Total Posts: 1301 |
|
|
| 18 Jan 2013 06:44 PM |
| PS the copy and paste somehow left the f in function behind. |
|
|
| Report Abuse |
|
|
lkbirds
|
  |
| Joined: 23 Sep 2010 |
| Total Posts: 1301 |
|
|
| 18 Jan 2013 09:30 PM |
| Bump. I have no idea what could be wrong it was working but it blew when the server started. So I saved and shut my computer down. Today nothing happens at all. |
|
|
| Report Abuse |
|
|