script: local TweenService = game:GetService("TweenService") -- smooth animation local hinge = script.Parent.Hinge local prompt = script.Parent.Door.ProximityPrompt local goalOpen = {} goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0) --getting current hinge CFrame and multiplying it so that it rotates it by 90 degrees. Converted to radians local goalClose = {} goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) --does the same thing but closes the door now local tweenInfo = TweenInfo.new(1) --takes one second for the tween to open and close local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) --we want to tween/rotate the hinge local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose) prompt.Triggered:Connect(function() if prompt.ActionText == "Close" then tweenClose:Play() prompt.ActionText = "Open" else tweenOpen:Play() prompt.ActionText = "Close" end end)
I had a problem with this one where my door opened upwards instead of side to side, so I fixed it. Here it is: local TweenService = game:GetService("TweenService") local hinge = script.Parent.Hinge local prompt = script.Parent.Door.ProximityPrompt local goalOpen = {} goalOpen.CFrame = hinge.CFrame * CFrame.Angles(math.rad(90), 0, 0) local goalClose = {} goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) local tweenInfo = TweenInfo.new(1) local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose) prompt.Triggered:Connect(function() if prompt.ActionText == "Close" then tweenClose:Play() prompt.ActionText = "Open" else tweenOpen:Play() prompt.ActionText = "Close" end end)
Protip: The door has to be unanchored. The Side, hinge, and everything else you added should be anchored, except the door with the proximityprompt. Also, if ur adding a handle, add a weldconstraint from door handle to the door, also make sure that’s also not anchored.
thank you very much!! I've been trying to look for tutorials on how to make a door open using the prompt but none of them i found used tweens. and instead of just taking a link from the description, i learned from you. and luckily got this to work first try
To anyone watching this!!! TO MAKE IT WORK download the model in the description. This is a good tutorial but to us noob scripters it is easy to get lost. With that being said refer to the model when copying the script as it is different (also easier to read lol) than the script in the video! Once again thank you Cyber!! :D
So I was gonna comment my issue with it, but then I realized "Oh wait. Prompts have a Line of Sight option. Since it's spawning inside my door, maybe that's the issue?" I've worked at this with hitboxes, and solved it by clicking one button. I wouldn't have made it nearly that far if I didn't have the door base. Thanks!
If you want to add door nobs to your door, I recommend you to wield the base into the door nobs so they can stay connected and follow the base of the door when your opening them
Anyone doing the fancy door script here you go: local TweenService = game:GetService("TweenService") local hinge = script.Parent.Doorframe.Hinge local prompt = script.Parent.Base.ProximityPrompt local goalOpen = {} goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90),0) local goalClose = {} goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) local tweenInfo = TweenInfo.new(1) local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose) prompt.Triggered:Connect(function() if prompt.ActionText == "Close" then tweenClose:Play() prompt.ActionText = "Open" else tweenOpen:Play() prompt.ActionText = "Close" end end)
If the door doesn't seem to move but the hinge does, make the door unanchored (hinge anchored) and make sure that the door is part1 in the weld and the hinge is part0
4 years ago I made a Roblox game we’re you have to survive a round that has a creepypasta (like Jeff the killer, slender man ect.) and I want to remake it so this helps a ton, thanks!
If your door is opening upside down use this script. It only changes one thing script: local TweenService = game:GetService("TweenService") -- smooth animation local hinge = script.Parent.Hinge local prompt = script.Parent.Door.ProximityPrompt local goalOpen = {} goalOpen.CFrame = hinge.CFrame * CFrame.Angles(math.rad(270), 0, 0) --getting current hinge CFrame and multiplying it so that it rotates it by 90 degrees. Converted to radians local goalClose = {} goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) --does the same thing but closes the door now local tweenInfo = TweenInfo.new(1) --takes one second for the tween to open and close local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) --we want to tween/rotate the hinge local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose) prompt.Triggered:Connect(function() if prompt.ActionText == "Close" then tweenClose:Play() prompt.ActionText = "Open" else tweenOpen:Play() prompt.ActionText = "Close" end end)
@@I_heart_jw no, prob u got same error than me (but i fixed it, very bruh error) - Hinge part anchored - Door part not anchored if works for you let me know
it doesn't work for me the "e" to open door just doesn't appear, and I rechecked the video several times and I did everything correctly several times and it still didn't work?
it DOES work, but the button to open it only appears for a slights second for some reason so it doesnt let me open it anyways. Please update this tutorial it doesn't work in 2024
This man, explained everything extremely well. Made this entire tutorial very easy to listen too, and pay attention too. You put the explanation of every command used in the script, on screen, so we could understand what it was doing in the script, and also put the model in the description. Absolutely amazing. Earned a sub for sure.
Can somebody help me. I have my own custom door which I made and only 1 part of the door is moving when I open/close it. Can somebody tell me how to make the other parts move too!
So, after successfully scripting the simple door, I tried to do follow the same steps for a door I had already made. It wasn't working, so I went back into the script and realized that my door had a lowercase d instead of an uppercase one (which messed up the script). After fixing this, my door now opens the other way..
Noob here. So I started this tutorial from beginning. Made my own door. After all that, it works flawlessly. Now I wanna add a knob on my original door. How do I add it and make it stick. It keeps falling down. I noticed the 2nd door you imported has a door knob. How did you make it stay? Was it anchored? Union? Grouped? I tried the 3 of them. But didn't stay.
I had to do quite a bit of tinkering to make it work in 2022 but I would of never got it done without this tutorial. Thank You so much! If anyone else is trying to get it to work and they want to see what I did I'd be happy to show them.
I know this is from three years ago, but say i wanted to make this like a click to open instead of e to open, how would I do that? i haven't really found any good tutorials on it yet
hey i just started learning how to script but theres one thing i can get down, i have a door made of multiple mesh parts but no scripts or anything, i welded all the parts together so its like a model but i can seem to script in it
To all the people saying it doesnt work Change Local door = script.Parent.Door Local hinge = script.Parent.Hinge To Local door = game.Workspace.Door Local hinge = game.Workspace.Hinge
How about a system like escape the darkness has where you have to do three different tasks. Two sets each. Like start the generators, grab notes, and find the exit door buttons. That would be a big help
mine isn't working for some reason. i followed the tutorial, and even downloaded the model to check the scripts. exactly the same, except with the names of my objects. i don't know what i did wrong. the tween works just fine. but i can't test if it works with the proximity prompt... because the prompt is invisible. i walk up and it's not there. it doesn't pop up. nothing happens if i press E.
Same I did everything right my output did not see anything wrong and so viewed my mistakes corrected them multiple times and it didn’t work I’ve had issues like this with many different scripts where it just would not work They were all on different games tho Is there a setting I need to enable for scripts to work? I am also on a team create game so is it something with that?
!!FOR ANYONE WHO NEEDS HELP BECAUSE IT DOESN'T WORK!! hi don't put the script in the door block instead, have it within the grouped set of blocks (The Parent of the Script should not be the door, but rather the group/model the door part is in)
@@imscrate ok so have 2 parts one as the hinge and the other as the door make sure they are all named correctly group all parts as a model insert the script INTO the model (so that the model is the parent) do NOT put it into one of the parts!!!! ok there
For some reason it doesnt work even though I did the exact same as you Edit: Ok I got your free model to see what I did wrong, but when I test it to see if it works it doesnt open either
I tried it but the door will not move at all and its not anchored I did use roblox coding recommendation feature but its recommendations were literally the same on the tutorial does anyone know how to fix this?
I replaced the empty parentheses on local goalOpen = () to braces {} same with the goalClose and made sure the caps all lined up properly it worked for me after that
Another outstanding video from my boy Cyber. I do have some questions though. When you’re rotating the CFrame of the door, why did you not just do 90 instead of math.rad(90)? Is there an explanation? What’s the meaning of Visual? How can you weld to Visual?
Visual is just the name of a part of the door. I should have made that more clear. There's a link in the description with the model if you want to check it out. You have to use math.rad because the CFrame.Angles function uses radians and not degrees so we need to convert the degrees into radians. This website explains radians in more detail if you aren't familiar www.mathsisfun.com/geometry/radians.html I'm planning on making a video on CFrames in the future
why am i getting " TweenService:Create no property named 'Cframe' for object 'Hinge' " error where am i suppose to put Cframe? i didnt see anything about that in the video
Thank you for linking the doors in the desc! It helped me firgure out what was wrong with my script and take a closer look at all the parts :D You're the first youtuber dev i've watch who has even done that! I will be subscribing for sure
like, to use a different key? just go to the properties tab while selecting the proximity prompt with the explorer, and scroll down to keyboard code and change it to whatever.
Heres the script (some of it is tweaked by me so don't copy that! local TweenService = game:GetService("TweenService") local door = script.Parent.Union local goalOpen = {} goalOpen.CFrame = Union.CFrame * CFrame.Angles(0, math.rad(90), 0) local goalOpen = {} goalOpen.CFrame = Union.CFrame * CFrame.Angles(0, 0, 0) local tweenInfo = TweenInfo.new(1) local tweenOpen = TweenService:Create(Union, tweenInfo, goalOpen) local tweenOpen = TweenService:Create(Union, tweenInfo, goalClose) prompt.Triggered:Connect(function() If prompt.ActionText == "Close" then tweenClose:Play() Prompt.ActionText = "Open" else tweenOpen:Play() prompt.ActionText = "Close" end end)
I got mine to work. But i didn't wryie the script. I went to the description, and i found the link to the model imported the model and used the script on another door.
the tween fires a tween.completed trigger (same as the proximity trigger) when its done playing, so you can just have the collide of the door turn off when the tween is started, and turn back on using tween.completed:connect(function() )
I want to make a script with door cooldown I mean I want to open the door and when it pass 10 secounds it automatically close down Could somebody help me
For some reason after it's opened, I don't get an option to close it again. I did configure it so that it only opens to 70 degrees and added a script that makes a sound play when the prompt is triggered. Do you know what the issue is? Edit: Fixed the issue, for some reason in my audio code I made it so the trigger distance would be set to zero after the script played the noise. Oops!
The script is local TweenService = game:GetService("TweenService") local door = script.Parent.Door local hinge = script.Parent.Hinge local prompt = door.ProximityPrompt local goalOpen = {} goalOpen.CFrame = hinge.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0) local goalClose = {} goalClose.CFrame = hinge.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) local tweenInfo = TweenInfo.new(1) local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose) prompt.Triggered:Connect(function() if prompt.ActionText == "Close" then tweenClose:Play() prompt.ActionText == "Open" else tweenOpen:Play() prompt.ActionText == "Close" end end) You're welcome
How do i make a door that doesnt have rotating stuff but only like lets say the closed part is visible the open is transparent and it switches when pressed E?
If you door still isn’t working. Make sure everything but the frame and hinge is unanchored. If it still doesn’t work make sure the welds are both active and enabled.
it isnt working for me, is there anyway u can copy the first script and paste it in response to this comment? im sure ive gotten everything right so its confusing that its not working for me. i did notice though, that lines 7 & 10 have red lines under the brackets at the end, i have no idea how to sort that out, i would love help, thank you! (also i do not have discord so i cannot communicate through there for help)
Like the video if this helped you out! Also at 3:13 I meant to say you could use local prompt = script.Parent.Door.ProximityPrompt
hi
I m having a problem. When I go to the beta features, I can't see the proximity promt there. Did this problem happened to you?
@@vaishalipatil6879 ProximityPrompts are no longer in beta so you don't need to enable it. You should be able to add them by default
it dosen't help me
the proximity prompt in beta feautures is deleted, i can't use it anymore, maybe if i have the oldest version i could use it
@justin kiana alfredo the proximity prompt is deleted from beta features because it isn't in beta. Everyone can use it by default
script:
local TweenService = game:GetService("TweenService") -- smooth animation
local hinge = script.Parent.Hinge
local prompt = script.Parent.Door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0) --getting current hinge CFrame and multiplying it so that it rotates it by 90 degrees. Converted to radians
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) --does the same thing but closes the door now
local tweenInfo = TweenInfo.new(1) --takes one second for the tween to open and close
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) --we want to tween/rotate the hinge
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
Thanks :)
bro thank you so much
ay thanks man
literal god
I had a problem with this one where my door opened upwards instead of side to side, so I fixed it.
Here it is:
local TweenService = game:GetService("TweenService")
local hinge = script.Parent.Hinge
local prompt = script.Parent.Door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(math.rad(90), 0, 0)
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
It's been 7 years since I touched roblox studio. This really helps!
Glad to hear that!
Im calling the cops
@@panzerlite8108 u still alive? 👁👄👁
I was 2 years
I was 6 When I did
Bro, when you put the explanation of each command you're writing on the script, it just makes the video perfect. You won a sub
Protip: The door has to be unanchored. The Side, hinge, and everything else you added should be anchored, except the door with the proximityprompt.
Also, if ur adding a handle, add a weldconstraint from door handle to the door, also make sure that’s also not anchored.
Absolute pro tip, thank you
@@royalbluegaming7763 Your welcome my guy, have fun with ur awesome door!
Alright thanks
What i can do when my door not moving only my hinge
It didn't work for me
Can't believe I didn't find out about this until now. This helps so much, thank you!
hi i have a problem so- when i press e the door doesnt open or the button doesnt say close what do i do?
So, I did all the steps that you did, and I even double-checked. But when I press "E", it doesn't open. Why is this?
WELL DID U PLACE THE SCRIPT INTO THE PART U WANT?
@@davidlau8005 brotha chill 💀
This helped me so much and i added a script to it where specific players can only open it.
You don't understand how proud I was when that door actually opened lol
thank you very much!! I've been trying to look for tutorials on how to make a door open using the prompt but none of them i found used tweens. and instead of just taking a link from the description, i learned from you. and luckily got this to work first try
To anyone watching this!!! TO MAKE IT WORK download the model in the description. This is a good tutorial but to us noob scripters it is easy to get lost. With that being said refer to the model when copying the script as it is different (also easier to read lol) than the script in the video! Once again thank you Cyber!! :D
no, you shouldnt rely on other things and actually learn. if you cant do it then try harder. this comment is bullshit
@@eoo403 It's just a video on how to make a door for people who don't know how to script.
@@levip.8961 im talking about the original comment, dont use the model and actually learn whats going on.
Your videos are so underrated keep doing what your doing dude its helping a lot of people.
Thanks, will do!
Is this easy?
So I was gonna comment my issue with it, but then I realized "Oh wait. Prompts have a Line of Sight option. Since it's spawning inside my door, maybe that's the issue?" I've worked at this with hitboxes, and solved it by clicking one button. I wouldn't have made it nearly that far if I didn't have the door base. Thanks!
Wow,first i had no clue,but now i released a roblox game with the help of your tutorials.Thank you so much! your tutorials always help sm❤
Name?
If you want to add door nobs to your door, I recommend you to wield the base into the door nobs so they can stay connected and follow the base of the door when your opening them
Union
Yeah, that’s what I tried to say on my comment lol
yes finally i found great tutorial after 4 months
Glad I could help!
Anyone doing the fancy door script here you go:
local TweenService = game:GetService("TweenService")
local hinge = script.Parent.Doorframe.Hinge
local prompt = script.Parent.Base.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90),0)
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
ok i did this and the e to open button appears now but it doesn’t actually open 😭😭😭 help :,) anyone know what i might’ve done wrong?
TYSM! This is perfect for my robber game. I will change the door to a vault :D
Good idea! Glad I could help!
what game is it, i want to try it, sounds fun
The door is not opening it says E Open but it doesn’t actually open
When I press e the thing that says how to open the door disappears for a second but comes back and the door does nothing.
same here
If the door doesn't seem to move but the hinge does, make the door unanchored (hinge anchored) and make sure that the door is part1 in the weld and the hinge is part0
Is there a way to make it so you need a key for it to open?
I'm new to scripting so I kinda need help lol
I am also new
4 years ago I made a Roblox game we’re you have to survive a round that has a creepypasta (like Jeff the killer, slender man ect.) and I want to remake it so this helps a ton, thanks!
If your door is opening upside down use this script. It only changes one thing
script:
local TweenService = game:GetService("TweenService") -- smooth animation
local hinge = script.Parent.Hinge
local prompt = script.Parent.Door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(math.rad(270), 0, 0) --getting current hinge CFrame and multiplying it so that it rotates it by 90 degrees. Converted to radians
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0) --does the same thing but closes the door now
local tweenInfo = TweenInfo.new(1) --takes one second for the tween to open and close
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen) --we want to tween/rotate the hinge
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
what if the button to open the door only appears at when you're spawining so it it doesn't let you open the door when you are in the game
Guys remember to disable the "Join Surfaces" in Model tab to you dont have any welds at the door. Otherwise, the door will not move
This worked
how?
pls tell
@@Blebo96 under the Mode: Geometric thingy
It doesn't work for me. I did everything I could to make it work but it didn't work. Can you please help me
Great video. Well explained and easy to follow along. Thanks for the helpful videos!
Thank you for the kind words!
i did everything but didn't work with me i wanna know why
@@I_heart_jw Same
@@moltendog8497 @maqua I think because of an update or something
@@I_heart_jw no, prob u got same error than me (but i fixed it, very bruh error)
- Hinge part anchored
- Door part not anchored
if works for you let me know
it doesn't work for me the "e" to open door just doesn't appear, and I rechecked the video several times and I did everything correctly several times and it still didn't work?
it DOES work, but the button to open it only appears for a slights second for some reason so it doesnt let me open it anyways. Please update this tutorial it doesn't work in 2024
This man, explained everything extremely well. Made this entire tutorial very easy to listen too, and pay attention too. You put the explanation of every command used in the script, on screen, so we could understand what it was doing in the script, and also put the model in the description. Absolutely amazing. Earned a sub for sure.
Im making a door for my game but every Time i try to Open it doesn't work is there do you know a way i could fix This?
Can somebody help me. I have my own custom door which I made and only 1 part of the door is moving when I open/close it. Can somebody tell me how to make the other parts move too!
Your voice is so calming and you help me make a game. I hope you get 10k subs
Thank you!
can anyone help? why is my door not opening..it got the open and close button but it wouldn't swing
ik ijm rlly late but maybe u anchored the door only hinge needs to be anchored
I dont know how but my door wont open
So, after successfully scripting the simple door, I tried to do follow the same steps for a door I had already made. It wasn't working, so I went back into the script and realized that my door had a lowercase d instead of an uppercase one (which messed up the script). After fixing this, my door now opens the other way..
Noob here. So I started this tutorial from beginning. Made my own door. After all that, it works flawlessly. Now I wanna add a knob on my original door. How do I add it and make it stick. It keeps falling down. I noticed the 2nd door you imported has a door knob. How did you make it stay? Was it anchored? Union? Grouped? I tried the 3 of them. But didn't stay.
NVM. Figured out. Just needed to weld the doorknob to the door.
@@the_am_trader I’m having the same issue, how did you do that?
I had to do quite a bit of tinkering to make it work in 2022 but I would of never got it done without this tutorial. Thank You so much!
If anyone else is trying to get it to work and they want to see what I did I'd be happy to show them.
can you please show me it doesnt work for me
literally how
please do!
Sorry guys but my computer isn’t functioning at the moment. I’ll send what I did as soon as I can.
@@thepolarpals alr
I know this is from three years ago, but say i wanted to make this like a click to open instead of e to open, how would I do that? i haven't really found any good tutorials on it yet
Just get a input a click detector instead of a proximity prompt and replace any mentions of proximity prompt in the script with click detector.
If the door is turning the wrong way, instead of it turning 90, make it turn -90
turns the other way howver u have told people the line which as a problem ty
hey i just started learning how to script but theres one thing i can get down, i have a door made of multiple mesh parts but no scripts or anything, i welded all the parts together so its like a model but i can seem to script in it
great vid as always cy!
Glad you liked it!
How do add door opening sounds effects to the doors?
For some reason it doesn’t work and it said script :7: Expected identifier when parsing expression, got )
Amazing Tutorial! Explains everything very well and is easy to use in any project due to soft-coding.
To all the people saying it doesnt work
Change
Local door = script.Parent.Door
Local hinge = script.Parent.Hinge
To
Local door = game.Workspace.Door
Local hinge = game.Workspace.Hinge
How about a system like escape the darkness has where you have to do three different tasks. Two sets each. Like start the generators, grab notes, and find the exit door buttons. That would be a big help
isn't that among us
@@LetGoMyLegosTyler no it is dead by daylight
buddy learn how to script if u wanna do something like that, dont beg other people for free scripts.
mine isn't working for some reason. i followed the tutorial, and even downloaded the model to check the scripts. exactly the same, except with the names of my objects. i don't know what i did wrong. the tween works just fine. but i can't test if it works with the proximity prompt... because the prompt is invisible. i walk up and it's not there. it doesn't pop up. nothing happens if i press E.
same here
Thank you, it doesn't work 👍
Bro it Works If you understand
Check your scripts and compare it to this video to see what went wrong and retrace your steps
make sure its not anchored
Bro no one understands that's why we're on this videos @@merryjane3018
Same I did everything right my output did not see anything wrong and so viewed my mistakes corrected them multiple times and it didn’t work
I’ve had issues like this with many different scripts where it just would not work
They were all on different games tho
Is there a setting I need to enable for scripts to work?
I am also on a team create game so is it something with that?
do i need to weld all the parts of the door and then weld it to the hinge? because it doesnt let me select the whole model (i made my own door btw)
i did the same plz tell me u got a awnser
!!FOR ANYONE WHO NEEDS HELP BECAUSE IT DOESN'T WORK!!
hi
don't put the script in the door block
instead, have it within the grouped set of blocks
(The Parent of the Script should not be the door, but rather the group/model the door part is in)
Didn't really make sense to me..
@@imscrate ok so
have 2 parts
one as the hinge and the other as the door
make sure they are all named correctly
group all parts as a model
insert the script INTO the model (so that the model is the parent)
do NOT put it into one of the parts!!!!
ok there
@@Tinpotic I see! Thank you very much
it still doesnt work
if you're trying to make a double door just go into the script find 90 and make it -90 for the opposite door😭yw
For some reason it doesnt work even though I did the exact same as you
Edit: Ok I got your free model to see what I did wrong, but when I test it to see if it works it doesnt open either
i have the same issue but the "more detailed door" works so i dont know
I forgot to undo a change I made to the script right before I uploaded it! Try again now!
@kuprk I forgot to undo a change I made to the script right before I uploaded it! Try again now!
It works thanks
I tried it but the door will not move at all and its not anchored I did use roblox coding recommendation feature but its recommendations were literally the same on the tutorial does anyone know how to fix this?
I replaced the empty parentheses on local goalOpen = () to braces {} same with the goalClose and made sure the caps all lined up properly it worked for me after that
Another outstanding video from my boy Cyber. I do have some questions though. When you’re rotating the CFrame of the door, why did you not just do 90 instead of math.rad(90)? Is there an explanation? What’s the meaning of Visual? How can you weld to Visual?
Visual is just the name of a part of the door. I should have made that more clear. There's a link in the description with the model if you want to check it out.
You have to use math.rad because the CFrame.Angles function uses radians and not degrees so we need to convert the degrees into radians. This website explains radians in more detail if you aren't familiar www.mathsisfun.com/geometry/radians.html
I'm planning on making a video on CFrames in the future
@@CyberCreator dude thank you! This explains 50% of my scripts that doesn’t work
@@CyberCreator If it uses radians then why didn't we have to use math.rad() for the x and z as well, that were zeros?
sorry i just dont know lol
@@betrayedpickle291 fair question! math.rad(0) is actually 0. 0 degrees is also 0 radians so we gave the degrees in radians when we just used 0.
@@CyberCreator i see now, thanks!
why am i getting " TweenService:Create no property named 'Cframe' for object 'Hinge' " error
where am i suppose to put Cframe? i didnt see anything about that in the video
Very awesome tutorial. I made it so it would close automatically but you can only open it again if it was closed :D
That's great! Thanks for watching!
Show me the code so that I can do the exact same thing.
@@gabrieltagonizer3720 bro someone made it, they can decide if its open source or not. you cant just steal someones code and force them to give you it
@@gabrieltagonizer3720 bruh.
i might be dumb can you explain what that means lmao
Thank you so much for this helpful tutorial I know were you live
Can we possibly add knock and lock/Unlock too?
do youknow what i might have did wrong bc i did not have 2 scripts?
bruh when you typed acion I got so mad I was like screaming "FIX IT"
Lol
Thank you for linking the doors in the desc! It helped me firgure out what was wrong with my script and take a closer look at all the parts :D
You're the first youtuber dev i've watch who has even done that! I will be subscribing for sure
can you make a vid of how to add like a key system or something like that
Live you videos btw :D
like, to use a different key? just go to the properties tab while selecting the proximity prompt with the explorer, and scroll down to keyboard code and change it to whatever.
can you please tell me how to make it work for 2022 I made the code EXACTLY the same and it doesn't
work
Heres the script (some of it is tweaked by me so don't copy that!
local TweenService = game:GetService("TweenService")
local door = script.Parent.Union
local goalOpen = {}
goalOpen.CFrame = Union.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalOpen = {}
goalOpen.CFrame = Union.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(Union, tweenInfo, goalOpen)
local tweenOpen = TweenService:Create(Union, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
If prompt.ActionText == "Close" then
tweenClose:Play()
Prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
thank you so much cybercreator doesnt give a shit about how long it takes to type this script
@@zeroidentityzyzyzy ?
@@0skillgamer wdym question mark its annoying for beginners
I DID ALL OF THIS ND IT DOESNT WORK!!!
Mine is broken too IT SAYS THE TWEE SERVICE IS NOT A VALID SERVICE NAME
@@A-37AndA-39tween*
@@MicrowesoftEdgeyeah..
womp womp (just a joke i cant resist)
I got mine to work. But i didn't wryie the script. I went to the description, and i found the link to the model imported the model and used the script on another door.
How do i make it that WHEN the door is opening, it can be passed through since its pretty annoying right now hitting it and stuff!
the tween fires a tween.completed trigger (same as the proximity trigger) when its done playing, so you can just have the collide of the door turn off when the tween is started, and turn back on using
tween.completed:connect(function()
)
can you make a E to open door, but with a keycard? and make it slide instead of setting it on a hench
It is giving me an error saying: TweenService:Create no property named 'Cframe' for object 'Hinge'.
What do I do? D:
Write CFrame not Cframe
why it doesn't work? i already try it for a month but still no results...
I LITERALLY DONT KNOW WHATS WRONG BUT IT JUST REFUSES TO WORK WHAT?????? NO ERROR MESSAGE NO NOTHING IT JUST DOESNT WORK
i have the script completely correct, however, when i go to test it nothing happens. the key " E " is shown but once pressed nothing changed. help?
Same here
Only my hinge moves. Does anyone know how to fix it?
I want to make a script with door cooldown
I mean I want to open the door and when it pass 10 secounds it automatically close down
Could somebody help me
When welding I don't see the "create" option, I play on laptop so maybe that's why.
SAME
it's because roblox studio got updated. Also roblox studio isn't different from device to device
i have a problem when i try to open door it doesnt work and it says something wrong with line 8
I tried but my door went flying somewhere else
so it work for me but i need that to make a truck door so the door need to not be anchor but when i unachor it it stop working.
For some reason after it's opened, I don't get an option to close it again. I did configure it so that it only opens to 70 degrees and added a script that makes a sound play when the prompt is triggered. Do you know what the issue is?
Edit: Fixed the issue, for some reason in my audio code I made it so the trigger distance would be set to zero after the script played the noise. Oops!
I can't get the door to swing open, could you help?
@@carat9023 did you add any additional scripts or parts to the model? Is the door part that’s connected to the hinge anchored?
@@CatMagglio It is anchored, and I don't think I added any extra scripts or parts, I have no idea whats wrong
Thanks! I needed this for a roleplay game I am Creating! Great Video, I subscribed.
Hey, me and my friend is trying to use this but the door itself just falls off when we put it on something
The script is
local TweenService = game:GetService("TweenService")
local door = script.Parent.Door
local hinge = script.Parent.Hinge
local prompt = door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalClose = {}
goalClose.CFrame = hinge.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText == "Open"
else
tweenOpen:Play()
prompt.ActionText == "Close"
end
end)
You're welcome
Also i wasted 20 minutes for it to not work
@@fuxew2 learn tweenservice bro
I wrote the script and it didn't work. Can u please put the script in the description?
when I did the script it says open door but it doesn't open?
How do i make a door that doesnt have rotating stuff but only like lets say the closed part is visible the open is transparent and it switches when pressed E?
just me or is there a red line under prompt whenever you write it? can someone please explain why this is happening?
Do you have to anchor the door or no cause I put the script but the door just falls down I will see if other videos you made work
dude i always watch your vids for tutorials tysm.
WHERE DID THE PROXIMITY PROMPT THING APPEAR I CANT FIND IT
thank you so much, the tutorial helped me with a problem last for 1 hour :) 🙏🙏
If you door still isn’t working. Make sure everything but the frame and hinge is unanchored. If it still doesn’t work make sure the welds are both active and enabled.
Thanks dude, it totally works! Tyvm! You will be the one to go to when I need RB Studio help!
how could you do a double door? (so that both sides open from one proximity prompt)
The door works but after i put it in a model it breaks (the prom after pressing it the door doesnt move) any help?
it isnt working for me, is there anyway u can copy the first script and paste it in response to this comment? im sure ive gotten everything right so its confusing that its not working for me. i did notice though, that lines 7 & 10 have red lines under the brackets at the end, i have no idea how to sort that out, i would love help, thank you! (also i do not have discord so i cannot communicate through there for help)
Is there a way i can add a claim house prompt into the door part within it's script before it gives the ability to do the E to open door prompt?
The script isnt working :( i spent an hour on this and it doesnt even work
I got it to open but it won't close, I checked the script like, five times. Is there any solution?
Nevermind it was confusing for a bit but i got my script to work! Thank you very much!