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: This error makes no sense...

Previous Thread :: Next Thread 
Xsysix is not online. 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 is not online. 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
MountainSnow is not online. MountainSnow
Joined: 15 Mar 2013
Total Posts: 3324
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 is not online. 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
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