I'm making a Tycoon, and I am trying to make some doors so that they look at least half decent so I was thinking, in a previous game I saw a very clever builder make windows that could be half-opened with a simple click of the mouse. I was thinking that I could do the same but with a door, and I was thinking: Is there an easy, simple way that I could build or script a door to make it open by clicking it? If there is: 1) Please let me know. 2) I can do the same with windows hopefully.
Thanks for reading!
Yes, there is. Even though it is a simple script, I won't make it. To open a window with a physical part, you'd need to insert a ClickDetector into the part and have a trigger for when the event is fired (When it's clicked) in a script. To manage the event firing, you'll need a connection line and a function. The event is called MouseClick.
This is NOT a request site! Please show us some indication that you tried.
--just pretend everything is defined... door.ClickDetector.MouseClick:connect(function() if not Open then door.CFrame = door.CFrame * CFrame.Angles(math.rad(90), 0, 0) Open = false else door.CFrame = door.CFrame * CFrame.Angles(math.rad(-90), 0, 0) Open = true end end)
Closed as Not Constructive by Goulstem, Shawnyg, and M39a9am3R
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?