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: Whats wrong with this CTF script?

Previous Thread :: Next Thread 
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 10:53 AM
There is a function which is this


function findAllFlagStands(root)
local c = root:children()
for i=1,#c do
if (c[i].className == "Model" or c[i].className == "Part") then
findAllFlagStands(c[i])
end
if (c[i].className == "FlagStand") then
table.insert(stands, c[i])
end
end
end



I call it later but the output refers to me calling the function nil

I tried calling it by

findAllFlagStands(root)
and
findAllFlagStands()
same result, whats wrong with it>?

Report Abuse
david1234501 is not online. david1234501
Joined: 04 Oct 2008
Total Posts: 737
05 Feb 2014 10:55 AM
Wouldn't it be easier to use a (for i, v in pairs(root) do) loop?
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 10:56 AM
uh idk how to do that, this script also makes the leaderboard so it adds on Kills and Points
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 11:02 AM
bmp
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 11:06 AM
bbbbbbbb
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 12:27 PM
s
Report Abuse
david1234501 is not online. david1234501
Joined: 04 Oct 2008
Total Posts: 737
05 Feb 2014 12:38 PM
function findAllFlagStands(root)
local c = root:GetChildren()
for i, v in pairs(c) do
if (v.className == "Model" or v.className == "Part") then
findAllFlagStands(v)
end
if (v.className == "FlagStand") then
table.insert(stands, v)
end
end
end
Report Abuse
david1234501 is not online. david1234501
Joined: 04 Oct 2008
Total Posts: 737
05 Feb 2014 12:39 PM
Oh, your problem is you did root:children(). It should be root:GetChildren() I think. Use the script I just posted and see if it works.
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
05 Feb 2014 12:58 PM
On what did you call root, OP?
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
05 Feb 2014 01:38 PM
@ above, ?


13:37:33.009 - Workspace.LinkedLeaderboard:80: attempt to call global 'findAllFlagStands' (a nil value)
13:37:33.010 - Script 'Workspace.LinkedLeaderboard', Line 80
13:37:33.011 - stack end

is the output after i put in your script, It was the same thing before i put it in aswell
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
06 Feb 2014 11:36 AM
function findAllFlagStands(root)
--things
end

What is root when you call the function?
Report Abuse
MarcsMinion is not online. MarcsMinion
Joined: 22 Oct 2011
Total Posts: 8734
06 Feb 2014 04:17 PM
uh line 2
Report Abuse
dodleman is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
06 Feb 2014 04:19 PM
OP clearly didn't make this.

Life is potatoes to me
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
06 Feb 2014 04:22 PM
^
Yeah and on top of that, he didn't call the function correct.
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