Sign up
Login
New paste
Home
Archive
English
English
Sign up
Login
New Paste
Browse
---------------------------------------------------------------------------------------------------- -- // Services \\ -- local PlayersService = game:GetService("Players") local CollectionService = game:GetService("CollectionService") -- // Constants \\ -- local DOORS = CollectionService:GetTagged("PrimaryDoor") local DoorModule = require(script.Parent.Parent.Libraries.DoorModule) local Permissions = require(script.Parent.Parent.Libraries.Permissions) ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- game.ReplicatedStorage.RemoteEvent.DoorSystem.OnServerEvent:Connect(function(player, doorModel, scannerModel) if not doorModel or not scannerModel then return false end if DoorModule.hasCooldown(doorModel) then return false end if not CollectionService:HasTag(doorModel, "PrimaryDoor") then return false end if doorModel:FindFirstChild("Configuration") == nil then return false end if doorModel.Configuration.DoorType.Value ~= script.Name then return false end if script.Parent.Parent.Libraries.Permissions:FindFirstChild(doorModel.Configuration.Permissions.Value) == nil then return false end -- if not DoorModule.canSeeDoor(doorModel, player.Character) then return false end local DoorConfiguration = DoorModule.returnDoorConfiguration(doorModel.Configuration.DoorType.Value) local DoorPermissions = Permissions.returnPermission(doorModel.Configuration.Permissions.Value) if not DoorPermissions then return warn("[DoorSystem] Unknown Door Permission.") end if not DoorPermissions.hasPermission(player) then scannerModel.PrimaryPart.Keycard_Denied:Play() scannerModel.PrimaryPart.Color = Color3.fromRGB(255, 0, 0) delay(2, function() if doorModel.Configuration.Lockdown.Value then scannerModel.PrimaryPart.Color = Color3.fromRGB(218, 133, 65) else scannerModel.PrimaryPart.Color = Color3.fromRGB(13, 105, 172) end end) DoorModule.setCooldown(doorModel, DoorConfiguration["Cooldown"]) return false else scannerModel.PrimaryPart.Keycard_Accepted:Play() scannerModel.PrimaryPart.Color = Color3.fromRGB(0, 255, 0) delay(2, function() if doorModel.Configuration.Lockdown.Value then scannerModel.PrimaryPart.Color = Color3.fromRGB(218, 133, 65) else scannerModel.PrimaryPart.Color = Color3.fromRGB(13, 105, 172) end end) end doorModel.Configuration.Open.Value = not doorModel.Configuration.Open.Value DoorModule.setCooldown(doorModel, DoorConfiguration["Cooldown"]) end) ---------------------------------------------------------------------------------------------------- for _, Door in pairs(DOORS) do if not CollectionService:HasTag(Door, "PrimaryDoor") then return false end if Door:FindFirstChild("Configuration") == nil then return false end if Door.Configuration.DoorType.Value ~= script.Name then return false end if script.Parent.Parent.Libraries.Permissions:FindFirstChild(Door.Configuration.Permissions.Value) == nil then return false end local DoorConfiguration = DoorModule.returnDoorConfiguration(Door.Configuration.DoorType.Value) Door.Configuration.Open:GetPropertyChangedSignal("Value"):Connect(function() if Door.Configuration.Open.Value then Door.Door0.PrismaticConstraint.Speed = DoorConfiguration["OpenSpeed"] Door.Door0.PrismaticConstraint.TargetPosition = DoorConfiguration["OpenTarget"] Door.Door1.PrismaticConstraint.Speed = DoorConfiguration["OpenSpeed"] Door.Door1.PrismaticConstraint.TargetPosition = DoorConfiguration["OpenTarget"] Door.Door0.Door_Open:Play() Door.Door0.Door_Close:Stop() else Door.Door0.PrismaticConstraint.Speed = DoorConfiguration["CloseSpeed"] Door.Door0.PrismaticConstraint.TargetPosition = DoorConfiguration["CloseTarget"] Door.Door1.PrismaticConstraint.Speed = DoorConfiguration["CloseSpeed"] Door.Door1.PrismaticConstraint.TargetPosition = DoorConfiguration["CloseTarget"] Door.Door0.Door_Open:Stop() Door.Door0.Door_Close:Play() end end) Door.Configuration.Lockdown:GetPropertyChangedSignal("Value"):Connect(function() if Door.Configuration.Lockdown.Value then for _, Scanner in pairs(Door:GetChildren()) do if CollectionService:HasTag(Scanner, "InteractionSystem") then Scanner.PrimaryPart.Color = Color3.fromRGB(218, 133, 65) end end else for _, Scanner in pairs(Door:GetChildren()) do if CollectionService:HasTag(Scanner, "InteractionSystem") then Scanner.PrimaryPart.Color = Color3.fromRGB(13, 105, 172) end end end end) end
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Do you like cookies?
🍪 We use cookies to ensure you get the best experience on our website.
Learn more
I agree