Xsysix
|
  |
| Joined: 29 Mar 2014 |
| Total Posts: 1182 |
|
|
| 04 Jun 2014 06:37 PM |
player = game.Players.LocalPlayer
for i,v in pairs(script.Parent:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Down:connect(function() player.TeamColor = BrickColor.new(game.Teams[v.Name].TeamColor) end) end end
"16:35:09.491 - Players.Player1.PlayerGui.IntroGUI.LocalScript:6: bad argument #1 to 'new' (Color3 expected, got userdata)"
What? It's a local script in a GUI with TextButtons in it.
- Add 1.5k | Deplexity | its a lego men game stop worrying |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 04 Jun 2014 06:39 PM |
Please stop blaming the script and start blaming yourself...
player.TeamColor = game.Teams[v.Name].TeamColor |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 06:40 PM |
local player = game.Players.LocalPlayer
for i,v in pairs(script.Parent:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Down:connect(function() if game:GetService("Teams"):FindFirstChild(v.Name) then player.TeamColor = game.Teams[v.Name].TeamColor end end) end end |
|
|
| Report Abuse |
|
|
Xsysix
|
  |
| Joined: 29 Mar 2014 |
| Total Posts: 1182 |
|
|
| 04 Jun 2014 06:40 PM |
Oh, now I feel stupid. And I wasn't blaming the script, the error just didn't make sense for what the problem was in my head. Now it makes sense.
Thanks :P
- Add 1.5k | Deplexity | its a lego men game stop worrying |
|
|
| Report Abuse |
|
|