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

How do you make a OnClick script with 2 parts?(Read Desc)

I kind of know how to make a OnClick script, but I need one that basically activates when you click a part. So lets say if I had two parts in 1 Model and I clicked a Part named (Part1), the next Part which would be Part2 would go transparent and canCollide. Basically Part1 would have the Click Detector and Part 2 would be the one effected by it. Please help me out if you know how to script this, lol it's a pain.

1 answer

✓ Accepted answer

It would look a bit like this

p1 = script.Parent.Part1
p2 = script.Parent.Part2
clickDetector = p1.ClickDetector
clickDetector.Clicked:connect(function()
p2.Transparency = 1
p2.CanCollide = false
end)

1 comment

1

Just call the event and have it change the properties of Part2

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