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

Can anyone help me with my CFrame door(s) script?

Asked by
Xetrax 85
10 years ago

I have yet another CFraming problem... and yet again it has to do with doors...

01--[Constants]:
02local Entry = script.Parent
03local D1 = Entry.L_Door
04local D2 = Entry.R_Door
05local CD1 = Entry.B1.ClickDetector
06local CD2 = Entry.B2.ClickDetector
07local Move = Entry.Motion
08local Lock = Entry.Close
09 
10--[Bool Values]:
11local Open = false
12 
13--[String Values]:
14local TextCode = "ABCD"
15 
View all 84 lines...

As you may be able to tell, this is one of my newer codes... so it's more structured...

0
What is the actual problem? 2eggnog 981 — 10y
0
The door's work in offline mode, but they do not work in online mode, and I have no idea why... Xetrax 85 — 10y
0
I am not sure if it has to do with the fact that "DoorValues" is a configuration object... Because I have a computer/database that stopped functioning too and it stores variables via a config. obj. Xetrax 85 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Some of your values are incorrect. The whole "External Values" section is wrong because you connect them to nil values. You have to connect it to the game, or to another Variable, and in this case you have done neither. It would have to look something like this:

1--[External Values]:
2local Values = game.Workspace.Entry.DoorValues
3local DoorStatus = game.Workspace.Entry.DoorValues.Status
4local DoorFault = game.Workspace.Entry.DoorValues.Fault
5local InMotion = game.Workspace.Entry.DoorValues.Moving --I'm not sure if "Moving" is a value. I assume it's a debounce, so I'll leave it be.
6local CodeType = game.Workspace.Entry.DoorValues.C_Type  --[0 = No Code, 1 = Keypad, 2 = Number, 3 = Group, 4 = Specific Person/People

Fix your other values as well, make sure to properly write the hierarchy.

Also, are "Lock" and "Move" audio bits? If not, then :Stop and :Play are useless.

Lastly, your connection line is.. Strange, to say the least. I'm not sure if that is actually a functioning bit of code, as I've never seen something like that, but your connection line should look something like this:

1CD1.MouseButton1Down:connect(MoveDoors) --I'm not sure if MouseButton1Down works on parts, if not then my apologies, as I mostly work with Guis.
2CD2.MouseButton1Down:connect(MoveDoors)

Try that, and then let me know what your Output says and what specifically the problem is.

0
Actually, the mousebutton1down refers to the clickdetector, if you followed the local preset values, the click detectors are named "CD" Xetrax 85 — 10y
0
Open is the DB, lock and move are audio, and the moving variable just tels when the door is actually moving (i.e. either closing, or opening) Xetrax 85 — 10y
0
It might be the mousebutton1down though, but It is working with a ClickDetector, not a TextButton. Xetrax 85 — 10y
0
I know that the Click Detectors were named "CD," that's not why I called your connection lines strange. I don't want you to change it to a TextButton either, I was just skeptical as to whether or not MouseButton1Down works on Parts. SlickPwner 534 — 10y
0
Yes, but the mouseclick has worked in most of my other models, the line of code just returns the player who clicked, so they specifically can be sent a GUI with the code (when I finish that func.). Xetrax 85 — 10y
Ad

Answer this question