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: Error, making me mad..

Previous Thread :: Next Thread 
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 10:19 PM
For some reason, this error Randomly happens, whenever it wants..

Error;
TeamColor is not a valid member of Tool
Workspace.Script, Line 50 - global reset
Workspace.Script, Line 81 - global games
Workspace.Script, Line 146

Script(s):
if game.Players:GetChildren()[i].TeamColor == game.Teams.Builder.TeamColor then --Line 50
game.Players:GetChildren()[i].TeamColor = game.Teams.Guesser.TeamColor
game.Players:GetChildren()[i].Character:MoveTo(game.Workspace.Model1.Lol1.Position)
game.Players:GetChildren()[i].PlayerGui.ScreenGui:Remove()
for i,v in pairs(game.Players:GetChildren()[i].Backpack:GetChildren()) do
v:Remove()
end
for i,v in pairs(game.Players:GetChildren()[i].StarterGear:GetChildren()) do
v:Remove()
end
end

Amount = 0
for i = 1, #game.Players:GetChildren() do
Amount = Amount + 1
end
if Amount >= 2 and gameStarted == false then
h.Text = "Starting game"
gameStarted = true
elseif Amount < 2 then
reset() --Line 81
end


while wait() do
games() -- Line 146
end



I triple checked it, and I see nothing where I bring up a Tool... Help? I am about to pull my hair out on this.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 10:20 PM
It worked fine, I went in, did some building, saved, and then out of no where that error came up.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 10:22 PM
The ONLY section in which I mention a tool at all:

Tools = game.Lighting:GetChildren()
for i = 1, #Tools do
if Tools[i]:IsA("Tool") or Tools[i]:IsA("HopperBin") then
Tool = Tools[i]:Clone()
Tool.Parent = Building.Backpack
Too2l = Tools[i]:Clone()
Too2l.Parent = Building.StarterGear
end
end
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 10:57 PM
Anyone? Or is everyone else stumped on this to?
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
21 Jan 2013 10:58 PM
"game.Players:GetChildren()[i].TeamColor "

?!?!?
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:01 PM
It is inside of a for statement. That part is fine.
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
21 Jan 2013 11:04 PM
xnite is right, that makes no sence.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:05 PM
for i = 1, #game.Players:GetChildren() do
if game.Players:GetChildren()[i].TeamColor == game.Teams.Builder.TeamColor then
game.Players:GetChildren()[i].TeamColor = game.Teams.Guesser.TeamColor
game.Players:GetChildren()[i].Character:MoveTo(game.Workspace.Model1.Lol1.Position)
game.Players:GetChildren()[i].PlayerGui.ScreenGui:Remove()
for i,v in pairs(game.Players:GetChildren()[i].Backpack:GetChildren()) do
v:Remove()
end
for i,v in pairs(game.Players:GetChildren()[i].StarterGear:GetChildren()) do
v:Remove()
end
end
end

Like I said, it inside of a for statement.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
21 Jan 2013 11:08 PM
local players = game.Players:GetPlayers()
for i = 1, #players do
if players[i].TeamColor == game.Teams.Builder.TeamColor then
--blah
end
end
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
21 Jan 2013 11:09 PM
If the for part doesn't make sense then you do not have enough knowledge to help him.
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
21 Jan 2013 11:10 PM
Is that the complete script? I'm pretty sure it's not. It's something in the reset function I believe.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:10 PM
That is not a difference at all. I even changed everything like how you posted, got same error

00:10:34 - TeamColor is not a valid member of Tool
00:10:34 - Script "Workspace.Script", Line 50 - global reset
00:10:34 - Script "Workspace.Script", Line 95 - global games
00:10:34 - Script "Workspace.Script", Line 160
00:10:34 - stack end
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:11 PM
@Ryan

I can't post the whole script, as it is to a game I am developing.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
21 Jan 2013 11:11 PM
^

If the way he's doing it actually works I'd lol, it's inefficient, ugly, and I've never seen it done like that. No offense.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:13 PM
@Az, wow, I just forgot to remove the previous one, I didn't realize having a Varaible was that important.. Thanks!

~Solved
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:14 PM
@Az, actually, the game works 100% fine, and not very many bugs, thanks for insulting me though.

Plsu, I just started scripting not 6 months ago, so I would say I am pretty advanced for that time length.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
21 Jan 2013 11:16 PM
I'm not insulting you, I'm just saying if that way actually worked I'd be very confused.
Report Abuse
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
21 Jan 2013 11:16 PM
Give me the reset function as that causes the error, the rest of the script doesn't matter.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:20 PM
Ah, well I am mistaken then, sorry.

I know I script very.. Differently, and poorly, but I try, and that is what matters.

Now, I have a whole entire different story..

00:17:03 - Character is not a valid member of Tool
00:17:03 - Script "Workspace.Script", Line 87 - global games
00:17:03 - Script "Workspace.Script", Line 147
00:17:03 - stack end

local Players = game.Players:GetChildren()
Building = Players[math.random(#Players)]
if Building.Character == nil then --87
wait(2)
Building.Character:MoveTo(game.Workspace.BSpawn.Position)
else
Building.Character:MoveTo(game.Workspace.BSpawn.Position)
end


How does that even relate to a tool? All it does it check the random players character, then TPs it... I swear, I know I am not the most advanced scripter, but a simple thing like that? How...
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:30 PM
The reset function is no longer part of the error
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:33 PM
I have no clue what this 'Tool' is that keeps coming up in my errors. I changed the part around, now I have a NEW error..

00:32:39 - TeamColor is not a valid member of Tool
00:32:39 - Script "Workspace.Script", Line 32 - global Checked
00:32:39 - Script "Workspace.Script", Line 147
00:32:39 - stack end


Building = 0
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == game.Teams.Builder.TeamColor then --Line 32
Building = Building + 1
end
end
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
21 Jan 2013 11:34 PM
I am SUCH AN IDIOT...

I had a tool inside of Players


-FACEDESK-
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
22 Jan 2013 12:16 AM
Drag I started in November 2 or 3 months ago, I'm way more advanced then you.
Report Abuse
dradra44 is not online. dradra44
Joined: 11 Jul 2008
Total Posts: 1040
22 Jan 2013 12:23 AM
You do not know how advanced I am. You do not even know me. Perhaps if you knew me, seen some of my working scripts, I would think differently, but instead, you go off of a broken code that I did after staying up 24 hours.

Good day.
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
22 Jan 2013 02:17 PM
Insulted yourself with your foolish lies.
Ask anyone who knows me on these forums.
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