Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local a={}function addTimer(b,c,d,e,...)local f=#a+1;a[f]={callback=b,label=e,arguments={...},time=c,currentTime=0,currentLoop=0,loops=d or 1,isComplete=false}return f end;function removeTimer(f)if a[f]then a[f]=0;return true end;return false end;function clearTimers()a={}end;function eventLoop(g,h)local i={}for f=1,#a do local j=a[f]if type(j)=='table'then if not j.isComplete then j.currentTime=j.currentTime+500;if j.currentTime>=j.time then j.currentTime=0;j.currentLoop=j.currentLoop+1;if j.loops>0 then if j.currentLoop>=j.loops then j.isComplete=true end end;if type(j.callback)=='function'then j.callback(j.currentLoop,table.unpack(j.arguments))end end end;if j.isComplete then if type(eventTimerComplete)=='function'then eventTimerComplete(f,j.label)end;i[#i+1]=f end end end;for k=1,#i do removeTimer(i[k])end
- -- Insira seu eventLoop aqui
- end
- novaClasse = function(object) -- o novaClasse pode ser renomeado para qualquer coisa
- local self = object -- self pode ser renomeado para qualquer coisa
- --[[
- Variáveis já existentes(são auto-adicionadas/elas se auto-atualizam nesse script):
- self.community (string)
- self.hasCheese (boolean)
- self.id (number)
- self.inHardMode (boolean)
- self.isDead (boolean)
- self.isFacingRight (boolean)
- self.isJumping (boolean)
- self.isShaman (boolean)
- self.isVampire (boolean)
- self.look (string)
- self.movingLeft (boolean)
- self.movingRight (boolean)
- self.playerName : Tigrounette (string)
- self.registrationDate (number)
- self.score (number)
- self.shamanMode (number)
- self.title (number)
- self.vx (number)
- self.vy (number)
- self.x (number)
- self.y (number)
- ]]--
- self.eventLoop = function() -- Criada a função dentro da classe
- local player = tfm.get.room.playerList[self.playerName]
- self.hasCheese = player.hasCheese
- self.inHardMode = player.inHardMode
- self.isDead = player.isDead
- self.isFacingRight = player.isFacingRight
- self.isJumping = player.isJumping
- self.isShaman = player.isShaman
- self.look = player.look
- self.movingLeft = player.movingLeft
- self.movingRight = player.movingRight
- self.score = player.score
- self.shamanMode = player.shamanMode
- self.title = player.title
- self.vx = player.vx
- self.vy = player.vy
- self.x = player.x
- self.y = player.y
- end
- local __init__=function() -- função principal
- self.timer = addTimer(self.eventLoop, 50, 0)
- end
- return {main=__init__}
- end
- for name,info in pairs(tfm.get.room.playerList) do
- system = novaClasse(info) -- system pode ser alterado para qualquer nome, se novaClasse for alterado lá no começo aqui também deve
- system.main() -- se system for alterado aqui também deve ser
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement