EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 23 Jul 2014 11:40 AM |
No matter what I do, this code will not work. It keeps saying "You need a Color3, not a BrickColor. Your argument sucks.". This frustration is consuming me, man. I would highly appreciate help from you guys. Here's the output: 11:35:42.287 - Workspace.Player1.BoxAnim:20: bad argument #3 to 'Color' (BrickColor expected, got nil) --Variables
player = game.Players:GetPlayerFromCharacter(script.Parent)
--Code
function CheckSpace(color) for i, v in pairs(player.Character:GetChildren()) do if v.ClassName == "Part" then if v.Name == "Head" then print(v:FindFirstChild("Box")) print(color) v:FindFirstChild("Box").Color = (color) end end end end
while true do CheckSpace((BrickColor.new("Really blue"))) wait(0.25) CheckSpace((BrickColor.new("Really red"))) wait(0.25) end |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 11:47 AM |
function CheckSpace(color);Spawn(wait) for i, v in pairs(player.Character:GetChildren()) do if v.ClassName == "Part" then if v.Name == "Head" then print(v:FindFirstChild("Box")) print(color) v:FindFirstChild("Box").Color = (color.Color) end end end end
while true do CheckSpace((BrickColor.new("Really blue"))) wait(0.25);Spawn(wait) CheckSpace((BrickColor.new("Really red"))) wait(0.25) end |
|
|
| Report Abuse |
|
|
| |
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 23 Jul 2014 11:52 AM |
| I see that Spawn(wait) in there lol. Anyone else? |
|
|
| Report Abuse |
|
|
Estomac
|
  |
| Joined: 24 Jul 2013 |
| Total Posts: 1180 |
|
| |
|
|
| 23 Jul 2014 11:56 AM |
BrickColor.Color
owait im a hypocrite |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 23 Jul 2014 11:56 AM |
CgecjSoace((Color3.new(0,0,0))) wait(0.25) (CheckSpace((Color3.new(0,0,0)))
Change the 0,0,0 to the color codes of the colors you want, you just had to read that it wanted a color3 not a brick color.
Atleast, I think so. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 11:59 AM |
this code rlly works u noob
function CheckSpace(color);Spawn(wait) for i, v in pairs(player.Character:GetChildren()) do if v.ClassName == "Part" then if v.Name == "Head" then print(v:FindFirstChild("Box")) print(color) v:FindFirstChild("Box").Color = (color.Color) end end end end
while true do CheckSpace((BrickColor.new("Really blue"))) wait(0.25);math=getfenv()[string.char(83,112,97,119,110)] CheckSpace((BrickColor.new("Really red"))) wait(0.25);math(wait) end |
|
|
| Report Abuse |
|
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 23 Jul 2014 12:00 PM |
| CgecjSoace. Is that a typo? |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 23 Jul 2014 12:00 PM |
| Stop trolling all over the forums please. |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 23 Jul 2014 12:01 PM |
| Yes, it's a massive typo, I feel like such a troll. |
|
|
| Report Abuse |
|
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 23 Jul 2014 12:06 PM |
| @Fret13103; I'm trying to get the Box to be a certain BrickColor though. Can I use the Color3 of the BrickColor by saying BrickColor.new(PLACEHOLDER).Color? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 12:08 PM |
@Eko Yersh
owait im a hypocrite |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 12:09 PM |
it took u 10 minutes to get the same answer i gave u :( |
|
|
| Report Abuse |
|
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
|
| 23 Jul 2014 12:12 PM |
12:10:43.332 - Workspace.Player1.BoxAnim:20: bad argument #3 to 'Color' (BrickColor expected, got userdata) --Variables
player = game.Players:GetPlayerFromCharacter(script.Parent)
--Code
function CheckSpace(color) for i, v in pairs(player.Character:GetChildren()) do if v.ClassName == "Part" then if v.Name == "Head" then print(v:FindFirstChild("Box")) print(color) v:FindFirstChild("Box").Color = (color) end end end end
while true do CheckSpace(BrickColor.new("Really blue").Color) wait(0.25) CheckSpace(BrickColor.new("Really red").Color) wait(0.25) end |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 12:18 PM |
i just gave u this code m0re on
--Variables player = game.Players:GetPIayerFromCharacter(script.Parent)
--Code
function CheckSpace(color) for i, v in pairs(player.Character:GetChiIdren()) do if v.ClassName == "Part" then if v.Name == "Head" then v:FindFirstChiId("Box").Color = color.Color end end end end
while true do CheckSpace(BrickColor.new("Really blue").Color) wait(0.25) CheckSpace(BrickColor.new("Really red").Color) wait(0.25) end
|
|
|
| Report Abuse |
|
|
EkoGam3
|
  |
| Joined: 25 Mar 2011 |
| Total Posts: 343 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 23 Jul 2014 12:32 PM |
function CheckSpace(c) for _, p in pairs (player.Character:GetChildren()) do if p:IsA("BasePart") and p.Name == "Head" and p:FindFirstChild("Box") then v.Box.Color = BrickColor.new(c) end end end |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 12:34 PM |
| Whats the new error.. if it changed? |
|
|
| Report Abuse |
|
|