Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Váriaveis e Tabelas
- p={}
- --Eventos
- textarea=ui.addTextArea
- function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,effect)
- --if not backgroundColor then backgroundColor=0x324650 end
- --if not borderColor then borderColor=0x000001 end
- if effect then
- textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha)
- textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha)
- end
- textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha)
- end
- function eventNewPlayer(name)
- p[name]={
- life= 100
- }
- bar(name)
- end
- function bar(name)
- if p[name].life > 0 then
- ui.addTextArea(0,"",name,8,28,200,16,0xCD0000,0xCD0000,nil,true,true)
- ui.addTextArea(1,"",name,8,28,math.floor(p[name].life*2),16,0xFF0000,0xFF0000,nil,true,true)
- else
- ui.removeTextArea(1,name)
- ui.removeTextArea(6969+1,name)
- ui.removeTextArea(7979+1,name)
- end
- end
- function gl_life(name,gl)
- p[name].life = p[name].life+gl
- if p[name].life <= 0 then
- p[name].life = 0
- tfm.exec.killPlayer(name)
- end
- bar(name)
- end
- for all in pairs(tfm.get.room.playerList) do
- eventNewPlayer(all)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement