generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Function dosnt run.

Previous Thread :: Next Thread 
lkbirds is not online. 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
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
18 Jan 2013 06:42 PM
if n < #childList then


childList is never defined.
Report Abuse
lkbirds is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image