|
| 17 Dec 2016 08:31 PM |
| I am working on an oven model for a cooking game i am planning to create, and I want the oven door to open when the handle is clicked. I assume this would be very similar to a door with a doorknob, so if anyone knows how to script that, that would be amazing if you could help. I am new so I am not that great at scripting. I have the model built, I just need someone to teach me how to do it. Not someone who is like "copy and paste the script from my profile" or something like that. Thanks! |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2016 09:51 PM |
| Cframeing the model downward would be the most cleanest way of doing it imo |
|
|
| Report Abuse |
|
|
Ocks67
|
  |
| Joined: 07 Mar 2009 |
| Total Posts: 7218 |
|
|
| 17 Dec 2016 10:08 PM |
| Wrong kind of oven in mind. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2016 10:04 AM |
| Bump because i still have no clue |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Dec 2016 04:57 PM |
There's an beginner way, and there's an experienced way. I only know the beginner way. This is what it is: First, Duplicate the oven door. Name the second oven door something like "Door2", anything will work as long as it's not named after the first door. Position it in a place that makes it look like the door was opened. Set the Door2 transparency to 1. Create a new script in part you click, and write the click function. (If you don't know how to write it, you can find an example on the Roblox wiki) Then create a NumberValue in the same part. Set the NumberValue's Value to 1. In the script, after the function, write "if script.Parent.Value.Value == 1 then" and after that, write some lines of script to change the first door's transparency to 1, and the second door's transparency to 0. Create a new line and make this one change the NumberValue's Value to 2. Copy and paste all the lines of the "if script.Parent.Value.Value == 1" to the next line, but change "Value == 1" to "Value == 2", and swap the transparency values around. (Change .Transparency = 0 to .Transparency = 1, and .Transparency = 1 to .Transparency = 0 .) |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2016 04:58 PM |
| Oh, and change "script.Parent.Value.Value = 2" to "script.Parent.Value.Value = 1" |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Dec 2016 04:59 PM |
Just use a hinge object lol
|
|
|
| Report Abuse |
|
|
|
| 18 Dec 2016 05:10 PM |
| But aren't hinges really glitchy? |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2016 05:11 PM |
make the door a model have a long hinge part make the hinge part the model's primarypart use :SetModelPrimaryPart.CFrame() to rotate the door
|
|
|
| Report Abuse |
|
|
|
| 18 Dec 2016 05:12 PM |
:SetPrimaryPartCFrame my bad lol
|
|
|
| Report Abuse |
|
|
|
| 20 Dec 2016 02:17 PM |
| Alright thanks I think i got it now |
|
|
| Report Abuse |
|
|