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

I'm trying to get it so when the click detector is pressed a part would go red any help?

So, I'm trying to figure out a code to change the color of my part Color1 but it's not working I'm making a game and I take the testing very seriously because without a working game it will get dislikes. And I've trying to make this script for about a day now.

Heres my script:

script.Parent.ClickDetector.MouseClick:connect(function()
 script.Parent.Color1.BrickColor = BrickColor.Red()
end)

I know it's not a lot but it's one of the main parts of my game.

Any help will be appreciated.

5 comments

0

ServerScript.

0

Make it a LocalScript then use a RemoteEvent.

0

Make sure that it's a server script.

0

K.

0

I'm confused look at the chat.

1 answer

✓ Accepted answer

Change the script to this:

function onClicked()
    script.Parent.BrickColor = BrickColor.Red()
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Tell me if your confused

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