Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data={}
- function eventLoop()
- for all in pairs(tfm.get.room.playerList) do
- if data[all] then
- if data[all].time < os.time()-120000 and data[all].elapsed < os.time()-12000 and data[all].dark > 75 and data[all].next == "night" then
- data[all].dark = data[all].dark - 5
- data[all].elapsed=os.time();
- if data[all].dark == 75 then
- data[all].time=os.time();
- data[all].next = "day"
- end
- end
- if data[all].time < os.time()-120000 and data[all].elapsed < os.time()-6000 and data[all].dark < 120 and data[all].next == "day" then
- data[all].dark = this.dark + 5
- data[all].elapsed=os.time();
- if data[all].dark == 120 then
- data[all].time=os.time();
- data[all].next = "night"
- end
- end
- ui.addTextArea(data[all].id,"",data[all].username,-300,-200,9999,9999,1,1,data[all].dark,true)
- end
- end
- end
- function eventNewPlayer(name)
- data[name]={
- id = os.time();
- time = os.time();
- elapsed = os.time();
- dark = 120;
- next = "night";
- }
- end
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement