EkoGam3Join Date: 2011-03-25 Post Count: 669 |
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 |
|
|
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 |
|
|
EkoGam3Join Date: 2011-03-25 Post Count: 669 |
I see that Spawn(wait) in there lol. Anyone else? |
|
EstomacJoin Date: 2013-07-24 Post Count: 1180 |
Haha |
|
|
BrickColor.Color
owait im a hypocrite |
|
fret13103Join Date: 2010-03-15 Post Count: 881 |
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. |
|
|
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 |
|
EkoGam3Join Date: 2011-03-25 Post Count: 669 |
CgecjSoace. Is that a typo? |
|
fret13103Join Date: 2010-03-15 Post Count: 881 |
Stop trolling all over the forums please. |
|
fret13103Join Date: 2010-03-15 Post Count: 881 |
Yes, it's a massive typo, I feel like such a troll. |
|
EkoGam3Join Date: 2011-03-25 Post Count: 669 |
@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? |
|
|
@Eko
Yersh
owait im a hypocrite |
|
|
it took u 10 minutes to get the same answer i gave u
:( |
|
EkoGam3Join Date: 2011-03-25 Post Count: 669 |
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 |
|
|
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
|
|
EkoGam3Join Date: 2011-03-25 Post Count: 669 |
Anyone else? |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
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 |
|
|
Whats the new error.. if it changed? |
|