Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Bolodefchoco << Criador da Script!
- --02/11/2015
- --[[ Um chat básico com alguns comandos para adm (Linha 1).
- /clear
- /cor (html)
- /flood número texto
- ]]--
- adm = {Sagazgamer=true}
- mice={}
- add = ui.addTextArea
- chat=function(message,title,player,x,y,w,h,p)
- message = message or ""
- _G.message = message
- title = title or "Chat"
- title = "</B></S></I><font face='Lucida Console'><p align='center'><V>"..title
- if player == nil then
- for i in pairs (tfm.get.room.playerList) do
- i = player
- end
- end
- x = x or 300-150/2
- y = y or 80
- w = w or 349
- h = h or 200
- ui.addPopup(0,2,'',p,x-1,y+200,w+1,true)
- add(0,'',player,x,y,w,h,0x324650,0x212E35,1,true)
- add(1,message,player,x+4,y+5,w-9,h-10,1,1,0,true)
- add(2,title,n,x-1,y-20,w+1,h-185,0x212E35,0x212E35,1,true)
- add(3,"<R><font size='15'><a href='event:chat_Close'><B>x</B></a></font></R>",player,x+325,y-25,25,25,1,1,0,true)
- end
- eventNewPlayer=function(n)
- chat(message,title,player,x,y,w,h,p)
- if not mice[n] then
- mice[n]={
- on = true,
- messagesoff = 0,
- }
- end
- end
- for n in pairs (tfm.get.room.playerList) do
- eventNewPlayer(n)
- end
- eventTextAreaCallback = function(i,n,c)
- if c=="chat_Close" then
- mice[n].on=false
- ui.addPopup(0,2,'',n,1e7,1e7,1,false)
- add(0,"<VP><p align='center'><a href='event:chat_Open'>Chat <J>"..mice[n].messagesoff,n,745,378,50,h,0x324650,0x212E35,1,true)
- add(1,"<VP><p align='center'><a href='event:chat_Open'>Chat <J>"..mice[n].messagesoff,n,745,378,50,h,0x324650,0x212E35,1,true)
- add(2,"<VP><p align='center'><a href='event:chat_Open'>Chat <J>"..mice[n].messagesoff,n,745,378,50,h,0x324650,0x212E35,1,true)
- add(3,"<VP><p align='center'><a href='event:chat_Open'>Chat <J>"..mice[n].messagesoff,n,745,378,50,h,0x324650,0x212E35,1,true)
- end
- if c=="chat_Open" then
- mice[n].on=true
- chat(message,title,player,x,y,w,h,p)
- end
- end
- eventPopupAnswer=function(i,n,a)
- if i == 0 then
- a=a:gsub("http","*")
- a=a:gsub('<','<')
- a=a:gsub("://","*")
- if adm[n] then
- cmd = {"/BLUE","/RED","/BL","/YELLOW","/N","/V","/GREEN","/PURPLE","/ROSE","/CH","/T","/ORANGE","/CEP","/CS","/N2","/PT","/S","/G"}
- html = {"<BV>","<R>","<BL>","<J>","<N>","<V>","<VP>","<VI>","<ROSE>","<CH>","<T>","<CE>","<CEP>","<CS>","<N2>","<PT>","<S>","<G>"}
- for k,v in pairs (cmd) do
- for i = 1,#html do
- a = a:gsub(v,html[k])
- end
- end
- if a == "/clear" then
- message = ""
- message = "<ROSE>[Chat] <VP>Clear #Admin"
- chat(message,title,player,x,y,w,h,n)
- end
- if a:sub(0,6) == "/flood" and type(tonumber(a:sub(8,9)))=='number' and a:sub(11)~="" then
- for v = 1,tonumber(a:sub(8,9)) do
- message = '<V>['..n..'] <N>' .. a:sub(11) .. '\n' .. message
- end
- chat(message,title,player,x,y,w,h,n)
- end
- end
- if a ~= "" and a ~= "/clear" and a:sub(0,6) ~= "/flood" then
- chat('<V>['..n..'] <N>'..a..'\n'..message,title,nil,x,y,w,h,n)
- else
- chat(message,title,player,x,y,w,h,n)
- end
- if #message > 1999 then
- message = ""
- message = "<ROSE>[Chat] <VP>Clear #2000"
- chat(message,title,player,x,y,w,h,n)
- end
- for n in pairs (tfm.get.room.playerList) do
- if mice[n].on == false then
- mice[n].messagesoff=mice[n].messagesoff+1
- add(0,"<VP><p align='center'><a href='event:chat_Open'>Chat <J>"..mice[n].messagesoff,n,745,378,50,20,0x324650,0x212E35,1,true)
- else
- mice[n].messagesoff=0
- end
- end
- end
- end
- eventLoop=function()
- for n in pairs (tfm.get.room.playerList) do
- if mice[n].on==false then
- eventTextAreaCallback(i,n,"chat_Close")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement