Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Instead of using BrickColor?

Asked by 8 years ago

I've been working on this project and I'm sooo close. My function is that when you hit the Blue button on the GUI, the Suitcase (named handle) turns to that color blue. I'm trying to use Brickcolor, but someone told me it WAS NOT Brickcolor, and to use something else, but what should I use?

local player = game.Players.LocalPlayer
local bag = player.Backpack:WaitForChild("Suitcase"):WaitForChild("Handle")
bag = script.Parent.Parent.Parent.Parent

function onClick()
    bag.BrickColor = BrickColor.new("Bright blue")
end

script.Parent.MouseButton1Click:connect(onClick)

0
You've posted so many questions on near-miss identical topics, please reduce the amount of questions you're posting. PowerHotmail123 90 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

MouseButton1Down is for GUIs.

if script.Parent means the tool then the code should go something like this.

local player = game.Players.LocalPlayer
local bag = player.Backpack:WaitForChild("Suitcase"):WaitForChild("Handle")
bag = script.Parent.Parent.Parent.Parent

function onClick()
    bag.BrickColor = BrickColor.new("Bright blue")
end

script.Parent.Activated:connect(onClick)
Ad
Log in to vote
0
Answered by 8 years ago

Parts use BrickColor and other objects, such as GUIs, use Color3.

0
So, in my script would I replace on the function BrickColor's and replace them with Color3s...? VirtualFlying 55 — 8y
0
Parts cannot directly accept a Color3. You must use the BrickColor.new constructor when working with parts. If you want to use Color3s with parts, you must use a syntax similar to this: BrickColor.new(Color3.new(1, 1, 1)). The code you are using looks correct and more efficient. emaster2013 30 — 8y

Answer this question