|
| 12 Jun 2014 04:09 PM |
owner = tostring(game.Players:FindFirstChild(v.Parent.Name).TeamColor)
It's at this line.
At the top, owner is clearly defined.
owner = "White"
Everything works but this part:
if script.CapStatus.Value <= 0 then owner = tostring(game.Players:FindFirstChild(v.Parent.Name).TeamColor) end |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 04:13 PM |
Perhaps you should do
game.Players:GetPlayerFromCharacter(v.Parent).TeamColor
Not sure, but why are you using strings instead of just brickcolor? It seems unnecessary |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 04:15 PM |
| Yeah I'm using strings. I already have it in the rest of the script, and I'm too lazy to change it all. :P |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 04:18 PM |
Does v.Parent exist for all values of v?
Also, I'm pretty sure you don't have to use tostring. You should be able to say TeamColor.Name to get the string representation of a BrickColor. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Jun 2014 04:20 PM |
@Admiral, I use a check. My script uses Region3 to check for parts.
"if v:IsA('BasePart') and v.Name == "Torso" and v.Parent:FindFirstChild('Humanoid') and game.Players:FindFirstChild(v.Parent.Name) then"
This is the check. There are no syntax errors. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 04:27 PM |
| Well I guess I'll have to improvise. :3 |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 12 Jun 2014 04:28 PM |
owner=BrickColor.new'White'.Color;
lol. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 04:30 PM |
If v.Parent is a character, then as Citrelthkarr said you should use the GetPlayerFromCharacter method.
However, this might fail if there is no player that corresponds to that character. Do you have anything in your game that might be considered a character (e.g. has a torso, Humanoid, and head) but is not controlled by a player (such as an NPC)?
If not then I'm afraid I'm out of ideas. |
|
|
| Report Abuse |
|
|