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 » Scripters
Home Search
 

value isn't being removed from table?

Previous Thread :: Next Thread 
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
01 Jan 2017 11:32 AM
archerAmtlocal function spawnTower(towerType,amt,map)
archerAmt = 0
for i = 1,amt,1 do
local spawns = map.TowerSpawns
local spawntable = {}
for i,s in next,spawns:GetChildren() do
table.insert(spawntable,s)
end
local t = spawntable[math.random(1,#spawntable)]
local pos = t.Position
for i,v in next,spawntable do
if v == t then
table.remove(spawntable,i)
end
end
local tower = game.ServerStorage[towerType]:Clone()
tower.Parent = workspace
tower:MoveTo(pos)
tower:MakeJoints()
for i,v in next,tower:GetChildren() do
if v:IsA("Part") then
v.Anchored = false
end
if string.find(v.Name,"Noob") then
archerAmt = archerAmt + 1
end
end
end
end

it will spawn towers in the same spot

meaning my removing method is not working

not sure why


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
01 Jan 2017 11:36 AM
oh ignore the thing at the top i pasted the wrong thing at first


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
UltimateRaheem is not online. UltimateRaheem
Joined: 10 Nov 2012
Total Posts: 1886
01 Jan 2017 11:36 AM
The roblox wiki recommends iterating over tables using ipairs so that the indexes are in numerical order.


http://wiki.roblox.com r+://169950678
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
01 Jan 2017 11:37 AM
@Ultimate

that won't make a difference


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
UltimateRaheem is not online. UltimateRaheem
Joined: 10 Nov 2012
Total Posts: 1886
01 Jan 2017 11:38 AM
Oh and it'd be nice if you give us the output and give us the area of the code with the error is.


http://wiki.roblox.com
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
01 Jan 2017 11:39 AM
"Oh and it'd be nice if you give us the output and give us the area of the code with the error is."

there's no output




Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
TheGamer548 is not online. TheGamer548
Joined: 02 Oct 2013
Total Posts: 14
01 Jan 2017 11:40 AM
Add some print("Here?")'s in there or something to debug it and see what went wrong. Try not to use the same text the entire time though. You could do print("1"), print("2"), print("3"), etc.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
01 Jan 2017 11:42 AM
ok i fixed it

i just had to rearrange some stuff

thanks though guys


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
01 Jan 2017 11:43 AM
sure, no problem

Formerly ToxicDominator - add 30,319 posts
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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