Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local operable = {}
- operable.start = function()
- for i, v in pairs(_G.operables:GetChildren()) do
- for i, k in pairs(v:GetChildren()) do
- local statusFolder = k.Status
- local operableType = statusFolder.Type.Value
- if operableType == "stash" then
- operable.stash(k)
- end
- end
- end
- for i, v in pairs(_G.mouseFilter.OperableRegions:GetChildren()) do
- coroutine.wrap(operable[v.Status.Function.Value])(v)
- end
- end
- operable.playerCounter = function(model)
- while wait(2) do
- local playerCount = 0
- for i, v in pairs(_G.characters:GetChildren()) do
- if v.Status.Role.Value == "Class-D" then
- playerCount = playerCount + 1
- end
- end
- local gui = model.Monitor.Screen.SurfaceGui.Frame.Frame.Card
- end
- end
- operable.stash = function(model)
- local itemRestriction = model.Status.ItemRestriction.Value
- model.Container.Touched:connect(function(hitObject)
- local itemModel = _G.item.getModel(hitObject)
- if itemModel then
- local statusFolder = itemModel.Status
- local itemStats = _G.stats.items[itemModel.Name]
- if itemStats and not statusFolder.JustSpawned.Value and (itemRestriction == "all" or itemRestriction == itemStats.type or itemRestriction == itemModel.Name) then
- statusFolder.JustSpawned.Value = true
- _G.item.drag(nil, false, itemModel)
- itemModel.Parent = _G.mouseFilter
- statusFolder.Name = itemModel.Name
- statusFolder.Parent = model.Status.Items
- coroutine.wrap(_G.client.sendToAllClients)("animateStashItem", itemModel, model)
- wait(.3)
- itemModel:Destroy()
- end
- end
- end)
- end
- operable.interact = function(player, request, operableType, model, ...)
- if operable[operableType] then
- operable[operableType](player, request, model, ...)
- end
- end
- operable.anchor = function(player, request, model, itemModel)
- if model.Status.Available.Value then
- model.Status.Available.Value = false
- for i, v in pairs(itemModel:GetChildren()) do
- if v:IsA("Part") or v:IsA("UnionOperation") then
- v.Anchored = true
- v.CanCollide = false
- end
- end
- model.Status.ItemModel.Value = itemModel
- _G.client.sendToAllClients("animateAnchorItem", itemModel, model)
- local anchorFunction = operable.misc[model.Status.Function.Value]
- model.Status.ItemModel.Value.ChildRemoved:connect(function()
- print("h")
- model.Status.Available.Value = true
- model.Status.ItemModel.Value = nil
- if anchorFunction then
- anchorFunction(false, model)
- end
- end)
- delay(.2, function()
- itemModel:SetPrimaryPartCFrame(model.Container.CFrame)
- if anchorFunction then
- anchorFunction(true, model)
- end
- end)
- wait(.5)
- itemModel.Parent = _G.items
- end
- end
- operable.misc = {}
- operable.misc.keycardReader = function(request, model)
- local gui = model.Computer.Screen.SurfaceGui.Windows.Screen
- if request then
- local itemModel = model.Status.ItemModel.Value
- local itemStats = _G.stats.items[itemModel.Name]
- model.Indicator.BrickColor = BrickColor.new("Bright green")
- model.Indicator.Granted:Play()
- gui.ID_Data.Display.Level.Text.Text = "L-" .. itemStats.clearanceLevel
- gui.ID_Data.Display.NameO.Text.Text = itemModel.Status.Content.ownerName.Value
- gui.ID_Data.Display.Role.Text.Text = itemModel.Status.Content.ownerRole.Value
- gui.ID_Data.Display.Rank.Text.Text = itemModel.Status.Content.ownerRank.Value
- gui.ID_Data.Visible = true
- else
- model.Indicator.BrickColor = BrickColor.new("Bright red")
- gui.ID_Data.Visible = false
- end
- end
- operable.search = function(player, request, model)
- if model.Status.Available.Value then
- model.Status.Available.Value = false
- for i, v in pairs(model.Status.Items:GetChildren() ) do
- local content = {}
- for i, k in pairs(v.Content:GetChildren()) do
- content[k.Name] = k.Value
- end
- print(v.Name)
- _G.item.spawn(nil, v.Name, model.Container.Position + Vector3.new(0, 1, 0), model.Container.Position + Vector3.new(3, 3, 0), content)
- v:Destroy()
- wait(.1)
- end
- model.Status.Available.Value = true
- end
- end
- operable.lock = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.lock
- local targetModel = model.Status.Target.Value
- model.Status.Enabled.Value = request
- model.Status.Target.Value.Status.Locked.Value = request
- wait(.6)
- if request then
- for i, v in pairs(model.Triggers:GetChildren()) do
- local screenObject = v:FindFirstChild("Screen")
- if screenObject then
- v.Screen.Unlocked:Stop()
- v.Screen.BrickColor = BrickColor.new("Bright red")
- end
- end
- else
- for i, v in pairs(model.Triggers:GetChildren()) do
- local screenObject = v:FindFirstChild("Screen")
- if screenObject then
- v.Screen.Unlocked:Play()
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- end
- local unlockedTime = model.Status.UnlockedTime.Value
- if unlockedTime > -1 then
- wait(unlockedTime)
- model.Status.Available.Value = true
- operable.lock(player, true, model)
- end
- end
- model.Status.Available.Value = true
- end
- end
- operable.normal = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.normal
- coroutine.wrap(_G.client.sendToAllClients)("animateNormalDoor", request, model)
- wait(.1)
- if request then
- model.Triggers.Trigger.Handle.Open:Play()
- model.Triggers.Trigger:SetPrimaryPartCFrame(model.Triggers.Trigger:GetPrimaryPartCFrame() * operableStats.enabledOffsetCFrame)
- wait(operableStats.openTime - .1)
- else
- model.Triggers.Trigger:SetPrimaryPartCFrame(model.Triggers.Trigger:GetPrimaryPartCFrame() * operableStats.disabledOffsetCFrame)
- wait(operableStats.closeTime - .1)
- model.Triggers.Trigger.Handle.Close:Play()
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.cage = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.cage
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- wait(1)
- coroutine.wrap(_G.client.sendToAllClients)("animateCageDoor", request, model)
- wait(.1)
- model.Door.Main.Start:Play()
- if request then
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.enabledOffsetCFrame)
- wait(operableStats.openTime - .1)
- else
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.disabledOffsetCFrame)
- wait(operableStats.closeTime - .1)
- end
- model.Door.Main.End:Play()
- for i, v in pairs(model.Triggers:GetChildren()) do
- if request then
- v.Screen.BrickColor = BrickColor.new("Bright red")
- else
- v.Screen.BrickColor = BrickColor.new("Bright green")
- end
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.bars = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.bars
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- coroutine.wrap(_G.client.sendToAllClients)("animateBarsDoor", request, model)
- wait(.1)
- for i, v in pairs(model.Door:GetChildren()) do
- v.Start:Play()
- end
- if request then
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.enabledOffsetCFrame)
- wait(operableStats.openTime - .1)
- else
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.disabledOffsetCFrame)
- wait(operableStats.closeTime - .1)
- end
- for i, v in pairs(model.Triggers:GetChildren()) do
- if request then
- v.Screen.BrickColor = BrickColor.new("Bright red")
- else
- v.Screen.BrickColor = BrickColor.new("Bright green")
- end
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.double = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.double
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- wait(1)
- if request then
- coroutine.wrap(_G.client.sendToAllClients)("animateDoubleDoor", true, model)
- wait(.1)
- model.Frame.Open:Play()
- model.Doors.Door1.CFrame = model.Doors.Door1.CFrame * operableStats.enabledOffsetCFrame
- model.Doors.Door2.CFrame = model.Doors.Door2.CFrame * operableStats.enabledOffsetCFrame
- wait(operableStats.openTime - 1.1)
- model.Status.Enabled.Value = true
- if model.Status.Sleep.Value then
- wait(operableStats.sleepTime)
- model.Status.Available.Value = true
- operable.double(player, false, model)
- else
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Bright red")
- end
- end
- else
- coroutine.wrap(_G.client.sendToAllClients)("animateDoubleDoor", false, model)
- wait(.1)
- model.Frame.Close:Play()
- model.Doors.Door1.CFrame = model.Doors.Door1.CFrame * operableStats.disabledOffsetCFrame
- model.Doors.Door2.CFrame = model.Doors.Door2.CFrame * operableStats.disabledOffsetCFrame
- wait(operableStats.closeTime)
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Bright green")
- end
- model.Status.Enabled.Value = false
- end
- model.Status.Available.Value = true
- end
- end
- operable.single = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.single
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- wait(1)
- coroutine.wrap(_G.client.sendToAllClients)("animateSingleDoor", request, model)
- wait(.1)
- if request then
- model.Frame.Open:Play()
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.enabledOffsetCFrame)
- wait(operableStats.openTime - .1)
- else
- model.Frame.Close:Play()
- model.Door:SetPrimaryPartCFrame(model.Door:GetPrimaryPartCFrame() * operableStats.disabledOffsetCFrame)
- wait(operableStats.closeTime - .1)
- end
- for i, v in pairs(model.Triggers:GetChildren()) do
- if request then
- v.Screen.BrickColor = BrickColor.new("Bright red")
- else
- v.Screen.BrickColor = BrickColor.new("Bright green")
- end
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.hatch = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local operableStats = _G.stats.operables.hatch
- coroutine.wrap(_G.client.sendToAllClients)("animateHatch", request, model)
- wait(.1)
- if request then
- model.Triggers.Trigger.Main.Open:Play()
- model.Triggers.Trigger:SetPrimaryPartCFrame(model.Triggers.Trigger:GetPrimaryPartCFrame() * operableStats.enabledOffsetCFrame)
- wait(operableStats.openTime - .1)
- else
- model.Triggers.Trigger:SetPrimaryPartCFrame(model.Triggers.Trigger:GetPrimaryPartCFrame() * operableStats.disabledOffsetCFrame)
- wait(operableStats.closeTime - .1)
- model.Triggers.Trigger.Main.Close:Play()
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.lights = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- for i, v in pairs(model.Lights:GetChildren()) do
- if v:FindFirstChild("Status") and v.Status.Type.Value == "light" then
- operable.light(player, request, v)
- wait(.1)
- end
- end
- for i, v in pairs(model.Triggers:GetChildren()) do
- if request then
- v.Screen.BrickColor = BrickColor.new("Bright red")
- else
- v.Screen.BrickColor = BrickColor.new("Bright green")
- end
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.light = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local lightType = model.Status.LightType.Value
- if lightType == "suspended" then
- if request then
- model.Bulb.Material = Enum.Material.Neon
- else
- model.Bulb.Material = Enum.Material.SmoothPlastic
- end
- model.Bulb.Light.Enabled = request
- model.Bulb.SpotLight.Enabled = request
- elseif lightType == "inlaid" then
- if request then
- model.Material = Enum.Material.Neon
- else
- model.Material = Enum.Material.SmoothPlastic
- end
- model.Tick:Play()
- model.SpotLight.Enabled = request
- end
- model.Status.Enabled.Value = request
- model.Status.Available.Value = true
- end
- end
- operable.scan = function(player, request, model)
- if model.Status.Available.Value and model.Status.Enabled.Value ~= request then
- model.Status.Available.Value = false
- local scannerType = model.Status.ScannerType.Value
- local operableStats = _G.stats.operables[scannerType]
- if scannerType == "penitentiary" then
- end
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Deep orange")
- end
- model.Status.Enabled.Value = true
- local gui = model.Monitor.Screen.SurfaceGui.Frame.Frame.Main.Main
- local scannedPlayers = {}
- coroutine.wrap(_G.client.sendToAllClients)("animateScanner", model)
- wait(operableStats.scanTime)
- for i, v in pairs(_G.players:GetPlayers()) do
- if _G.misc.isPartWithinRegion3(v.Character.HumanoidRootPart, model.Status.Region.Value) then
- table.insert(scannedPlayers, v)
- end
- end
- for i, v in pairs(model.Triggers:GetChildren()) do
- v.Screen.BrickColor = BrickColor.new("Bright red")
- end
- gui.Count.Count.Text = #scannedPlayers
- model.Status.Enabled.Value = false
- model.Status.Available.Value = true
- wait(10)
- if model.Status.Available.Value then
- gui.Count.Count.Text = "--"
- end
- end
- end
- return operable
Advertisement
Add Comment
Please, Sign In to add comment