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

Change the property of cancollide with a button?

Asked by 11 years ago

I would like to connect one button to 8 bricks, I need these bricks to be cancollide when the button is enabled and uncancollide when the button is unenabled. I was wondering if this was an easy script? If not could someone make it and PM me at, Ffbryce1 on my account to get it to me?

3 answers

Log in to vote
0
Answered by 11 years ago

Their is a way, to make a button and collide. It's like a door and admin script when you put the player name, like this : "Door1", "Door2" , "Door3" You can try on your own, if you can.

Ad
Log in to vote
0
Answered by 11 years ago

See I dont know how to script but I know it would be like if Button disabled = ("door1","door2") collide

and opposite with other? Could someone type up the script and slap it in the comments if its that easy?

Log in to vote
0
Answered by
u_g 90
11 years ago
  1. Name your 8 blocks "Part1", "Part2", "Part3", "Part4", "Part5", "Part6", "Part7", and "Part8" (not your button)
  2. Group all of the blocks together, and insert this script in your button(not in any of the parts, but actually in the model).

Script:

01local opening = false
02local function onTouched(hit)
03if opening == true then return end -- don't do anything if it is already opening
04if opening == false then
05opening = true
06print("Brick was touched") -- optional
07script.Parent.Parent.Part1.Transparency = 1 -- make it transparent, but it's optional
08script.Parent.Parent.Part1.CanCollide = false
09script.Parent.Parent.Part2.Transparency = 1
10script.Parent.Parent.Part2.CanCollide = false
11script.Parent.Parent.Part3.Transparency = 1
12script.Parent.Parent.Part3.CanCollide = false
13script.Parent.Parent.Part4.Transparency = 1
14script.Parent.Parent.Part4.CanCollide = false
15script.Parent.Parent.Part5.Transparency = 1
View all 44 lines...

Hope I helped. This took a while to write out. Tell me if there's an error.

0
Yeah, thank you for taking the time. I need to know how to put it on a click button not touch. And they will not reappear. I would like them to be instant on and instant off. I want them to be on forever until I turn the button off. Like a light switch. Ffbryce1 0 — 11y

Answer this question