Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// SEND TO PRISON IF PLAYER LEAVES WHILE BEING DETAINED
- game:GetService("ReplicatedStorage").Detain.OnServerEvent:Connect(function(player, tplayer, value)
- if player.TeamColor == game.Teams.Sentinel.TeamColor then
- local detainstore = DataStore2("detains", tplayer)
- detainstore:Set(value)
- end
- end)
- game.Players.PlayerAdded:Connect(function(plr)
- local detainstore = DataStore2("detains", plr)
- local isdetained = detainstore:Get(false)
- if isdetained then
- local arrestStore = DataStore2("arrests", plr)
- local arrestHistory = arrestStore:GetTable({})
- local note = ("This player left while being detained.")
- table.insert(arrestHistory, note)
- arrestStore:Set(arrestHistory)
- session[plr.UserId] = defaultTime
- jailPlayer(plr)
- detainstore:Set(false)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement