Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[ SOLVED ] How do I make a door that contains multiple parts?

Asked by 4 years ago
Edited 4 years ago

I'm making a game on ROBLOX and I made a house. I'm trying to script the door so it can function or work but I only know the basics of scripting and I'm bad a scripting. I made a script and it works but after a while it just stops working or not function. I'm very bad at coding so it's not a surprise to me that it doesn't work. I checked the output section and it says that one of my variables is not working but I don't know what to do and I get very confused on what to do. I tried multiple attempts to make the script work but it just failed. Can you please help me fix the script?

If you'd like to see the script here it is:

local DoorA = game.Workspace.DoorModel.DoorA.DoorA
local DoorB = game.Lighting.DoorHolder_MODEL.DoorB.DoorB
local DoorHolder = game.Lighting.DoorHolder_MODEL
local DoorModel = game.Workspace.DoorModel

function onClick(click)
    DoorA.Parent = DoorHolder.DoorA 
    DoorB.Parent = DoorModel.DoorB
end

script.Parent.MouseClick:Connect(onClick)

I know it's bad but it's the best I could do...

0
I might be able to help you if you show me the code. alivemaeonman 14 — 4y
0
Okay, Sorry for the late respsonse OreoCakelover 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I think this might be very helpful to you: https://www.youtube.com/watch?v=b0GjnMe4Tq4

and: https://www.youtube.com/watch?v=c_J_2fgAV98

and https://www.youtube.com/watch?v=NihGyByDd_4&list=PLuEQ5BB-Z1PKDygk3xYcdRelMWoNFFe3r&index=4

Some of the videos in this playlist show you how to make a working door using spring constraints, I'm pretty sure it doesn't have a lot (if any) scripting. The door opens when the player walks into it and closes shortly after.

0
Thank you, I'll try it later! OreoCakelover 17 — 4y
0
Uh... When I click the links it says “ The URL can’t be shown ”. Can you give me another link or help me find the video? OreoCakelover 17 — 4y
0
Thank you, it worked!! OreoCakelover 17 — 4y
Ad

Answer this question