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

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

Asked by 10 years ago

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

Log in to vote
2
Answered by 10 years ago

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
Just call the event and have it change the properties of Part2 Aaronoles 55 — 10y
Ad

Answer this question