Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I simply cant get it to work.. why is that happening??

what im tring to do is to choose if the plataform(which is a part) CanCollide proprety is false or true depending on the color of a brick called randomAll

    local P = workspace.Plataform
    local randomAll = workspace.Colour.Randomizer  --- Colour is a folder and Randomizer is a part


   while true do

   if randomAll.BrickColor.Color == BrickColor.new("New Yeller") then
    P.CanCollide = false 
   end

    if randomAll.BrickColor.Color == BrickColor.new("Really black") then
      P.CanCollide = false 
    end

    end

please,someone tell me whats wrong whit this? i tied a lot of others combinations No errors, just that when the script reaches this part,it just skips it..

3 comments

0

im noob at scripting.

0

is BrickColour readeble?cause i know it can be changed i mean.like an user id, you can ”see it”, but you cant change it.

0

Add a wait() , should help a lot :D

1 answer

✓ Accepted answer

Hello Gigaset39, It didn't take me long to figure out the problem, and after testing it out on Studio, It seems to be working:

Your Code:

if randomAll.BrickColor.Color == BrickColor.new("New Yeller") then
 P.CanCollide = false 
end

My Solution:

if randomAll.BrickColor == BrickColor.new("New Yeller") then
 P.CanCollide = false 
end

As you can see the only thing I did was remove "Color" from "BrickColor"

"Color" is a property of "BrickColor", yet it also is a property of Part

And by the way, remember to add a wait() in your loops

And that's it!

On the other side, if you for some reason wanted to change the Color Property and not the BrickColor property, it'd be different, as you don't use "BrickColor.new" on the Color Property, instead, It would be something like this:

randomAll.Color = Color3.new(248, 248, 248)

But that isn't necessary on this case

Hope this helps!

Full Code:

 local P = workspace.Plataform
 local randomAll = workspace.Colour.Randomizer  --- Colour is a folder and Randomizer is a part


while true do
wait(0.01)

if randomAll.BrickColor == BrickColor.new("New Yeller") then
 P.CanCollide = false 
end

 if randomAll.BrickColor == BrickColor.new("Really black") then
   P.CanCollide = false 
 end

 end

1 comment

1

idk why, but it works, i tryed that too,but it didint work,so i supose the problem was another one,thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.