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

Part touch button instead of player touch button? [closed]

Asked by
HjmanYT -1
7 years ago

How do I make a box just a 5,5,5 part and when the part slides onto the part(the button) it becomes green and it gets pushed down, but it player pushes the part off the button it goes up and the button becomes red. But when the block is on the button. a door opens. but if not on button doesnt open.

Closed as Not Constructive by lukeb50, hiimgoodpack, PyccknnXakep, and Void_Frost

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 7 years ago
script.Parent.Touched:connect(function(part)
if part.Name == "Box" then
--It touched the part and it is the box
script.Parent.BrickColor = BrickColor.new("Really red")
else
--it touched the part and it isn't the box
script.Parent.BrickColor = BrickColor.new("Lime green")
end
end)

You need to add some special to the box like name it "Box" or have something to define it

0
Oops just noticed i got colors wrong starblasto 43 — 7y
Ad