Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ZonePlus = require(4664437268) -- Initiate Zone+
- local ZoneService = require(ZonePlus.ZoneService) -- Retrieve and require ZoneService
- local NOT_CELL_TIME = workspace.Boundaries.NotCellTime -- A container (i.e. Model or Folder) of parts that represent the zone
- local zone_1 = ZoneService:createZone("NotCellTimeBoundaries", NOT_CELL_TIME, 15) -- Construct a zone called 'ZoneName' using 'group' and with an extended height of 15
- local function Between(input, num1, num2)
- if input >= num1 and input <= num2 then
- return true
- end
- end
- -- Zone 1 (Not Cell Time)
- zone_1.playerAdded:Connect(function(player)
- local char = player.Character or player.CharacterAdded:Wait()
- local innocent = player.PrisonerStats.Innocent
- if player.Team == game:GetService('Teams').Prisoners and not innocent.Value then
- print(player.Name,"entered the zone 1! Make player innocent. -- NOT CELL TIME")
- if char.Head:FindFirstChild('Not Innocent') then
- char.Head['Not Innocent']:Destroy()
- end
- player.PrisonerStats.Innocent.Value = true
- end
- end)
- zone_1.playerRemoving:Connect(function(player)
- local char = player.Character or player.CharacterAdded:Wait()
- local innocent = player.PrisonerStats.Innocent
- if player.Team == game:GetService('Teams').Prisoners and not char.Head:FindFirstChild('Not Innocent') then
- print(player.Name,"exited the zone 1! Make player guilty.")
- local UI = game.ReplicatedStorage.TSIC["Not Innocent"]:Clone()
- UI.Parent = char.Head
- innocent.Value = false
- end
- end)
- -- Main
- local isLooping = false
- local removeZone = false
- while (true) do
- wait(0.5)
- local clockTime = game:GetService('Lighting').ClockTime
- if not Between(clockTime, 0, 7) and not isLooping then
- print('Init Zone1')
- isLooping = true
- removeZone = false
- spawn(function()
- zone_1:initLoop()
- end)
- elseif not Between(clockTime, 0, 7) and isLooping then
- print('Zone1 --Free time')
- -- Do nothing
- elseif Between(clockTime, 0, 7) and not removeZone then
- isLooping = false
- removeZone = true
- zone_1:endLoop()
- elseif Between(clockTime, 0, 7) and not isLooping then
- print('Zone1 --Cell time')
- -- Do nothing
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement