Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. --// SEND TO PRISON IF PLAYER LEAVES WHILE BEING DETAINED
  2.  
  3. game:GetService("ReplicatedStorage").Detain.OnServerEvent:Connect(function(player, tplayer, value)
  4. if player.TeamColor == game.Teams.Sentinel.TeamColor then
  5. local detainstore = DataStore2("detains", tplayer)
  6. detainstore:Set(value)
  7. end
  8. end)
  9.  
  10. game.Players.PlayerAdded:Connect(function(plr)
  11. local detainstore = DataStore2("detains", plr)
  12. local isdetained = detainstore:Get(false)
  13. if isdetained then
  14. local arrestStore = DataStore2("arrests", plr)
  15. local arrestHistory = arrestStore:GetTable({})
  16. local note = ("This player left while being detained.")
  17. table.insert(arrestHistory, note)
  18. arrestStore:Set(arrestHistory)
  19. session[plr.UserId] = defaultTime
  20. jailPlayer(plr)
  21. detainstore:Set(false)
  22. end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement