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

How to make a tool activate and then changes its color to red?

Hello,

I would like the tool change color when the player activates it. I'm trying to make it like 3 mounths and my script is not working:

local brick = game.StarterPack.brick -- The tool

brick.Activated:connect(function()
	brick.BrickColor = ("New Yeller")
end)

Any help would be greatly appreciated.

Thank you, SquidoTV

2 comments

0

You mean equipped?

0

No. I mean activated

2 answers

Hello Squido! You should format your questions better. Put code within the code block. http://prntscr.com/g1428q

You want the tool to change colors when activated? Firstly, let me explain what Activated does

When you do a function that runs when a tool is Activated then that is when the player clicks with the tool equipped. So if you want it when activated, this will work: I'd so like to let you know to put this in a script inside the tool

tool = script.Parent
brick = tool.Brick --Change this to the parts location that you want to change

tool.Activated:connect(function()
brick.BrickColor = ("New Yeller") 
end)

Okay, so this changes the parts color to New Yeller when the player clicks. I do not fully understand your question so I'll also do this for you:

tool = script.Parent
brick = tool.Brick --Change this to the parts location that you want to change

function Equip()
brick.BrickColor = ("New Yeller") 
end)
tool.Equipped:connect(Equip)

So this runs when the tool is equipped. If you need anymore help, don't hesitate to ask! Also please remember in the future to use the code block when posting your code. http://prntscr.com/g1428q

3 comments

0

Put links in the link things so we can click on them

0

EddieLJones the script is not working i dont know why. And the script that i wanted its the activated script.

0

Because he had alot of errors. 1.) He didn't use WaitForChild 2.) he didn't do BrickColor = BrickColor.new

This is one way

tool = script.Parent
handle = tool:WaitForChild("Handle")
tool.Activated:Connect(function()
handle.BrickColor = BrickColor.new("Really red")
end)
tool.Unequipped:Connect(function()
handle.BrickColor = BrickColor.new("White")
end)

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