Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 11 Jan 2014 05:34 PM |
script.Parent.ClickDetector.MouseClick:connect(function(capture) name = capture.Name teamname = capture.TeamColor for i, v in pairs(game.Teams:GetChildren()) do if v.TeamColor == teamname then game.Workspace.owner.Value = end end end)
I'm trying to get a string value in the workspace with the name owner, I'm stuck on trying to figure out what to put on game.Workspace.owner.Value
I want it to be the color of the team from the person who clicked the part |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 11 Jan 2014 05:37 PM |
| whoops, I want it to be the name of the team of the person who clicked it, not the color |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
| |
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
| |
|
|
| 11 Jan 2014 05:44 PM |
Try this:
game.Workspace.owner.Value = tostring(capture.TeamColor) |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 11 Jan 2014 05:45 PM |
| I want the name of the team not the color |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 05:48 PM |
what I would do is to create a function for that, but there may be another way
local function getTeamName(color) for _,v in pairs(game.Teams:GetChildren()) do
if v.TeamColor == color then return v.Name end
return nil end
game.Workspace.owner.Value = getTeamName(capture.TeamColor) |
|
|
| Report Abuse |
|
|