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

How do I make an opening/rotating house door?

Hi! My name is Tobias.

I've been making models/NPCs on ROBLOX for a long time now and I want to learn to script.

The first thing I tried to do is script a rotating house door that opens when you click it. I used a tutorial, since I don't know how to script anyway. (I can not remember the script I used/tried to make to make the door open.)

I know a script to make parts spin/rotate constantly. Can I change this script to make a door open with a click detector and script?

Script/Code:

while true do script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ (0, 0.05, 0) wait () end

If you can help me modify this script to make a rotating opening door that would be great! (Also, if you can provide a script that is a script for an opening house door, that would be nice as well.)

If this is breaking the rules or not a good post, please email me with help for the opening door and an explanation on why this post was not right.

Thank you for reading.

  • Toby/Tobias

1 answer

Your First Question about your script, is No. I don't think that rotation might fit for a decent house door Let's see I used Motor6D, Easy way of making one was using this plugin: http://www.roblox.com/Motor6D-Maker-item?id=174430395

Script is:

function openDoor()
	-- Tells the Motor6D to rotate and open the door
	script.Parent.Parent.RotationPart.Motor.DesiredAngle = 1.55
	wait(2)
	-- Tells the Motor6D to rotate and close the door
	script.Parent.Parent.RotationPart.Motor.DesiredAngle = 0
end
-- Connect the Click Event
script.Parent.ClickDetector.MouseClick:connect(openDoor)

Demo: http://www.roblox.com/ClickDoor-item?id=321819609

My Apologies for this answer, as this might not fully explain how it works for you.

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