Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- anti fast warp
- -- if a player rejoins too soon after disconnecting then they are trying to
- -- fast-warp back to the station and should have their inventory confiscated
- local fastwarptime = 60
- hook.Add("ShutDown", 'sunrise_nofastwarp', function()
- for _, pl in pairs(player.GetAll()) do
- file.Write("sunrise/"..pl:UniqueID()..".txt", tostring(os.time()))
- end
- end)
- hook.Add("PlayerDisconnect", 'sunrise_nofastwarp', function(pl)
- file.Write("sunrise/"..pl:UniqueID()..".txt", tostring(os.time()))
- end)
- hook.Add("PlayerInitialSpawn", 'sunrise_nofastwarp', function(pl)
- if file.Exists("sunrise/"..pl:UniqueID()..".txt") then
- local leavetime=tonumber(file.Read("sunrise/"..pl:UniqueID()..".txt"))
- if os.time() <= (leavetime + fastwarptime) then
- timer.Simple(1, pl.Kill, pl) -- or something similar
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement