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

Part touch button instead of player touch button?

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.

1 answer

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

1 comment

0

Oops just noticed i got colors wrong

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