Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Hass
- --Made in: 18/01/2020
- --Last update: 18/01/2020
- --[[ Notes:
- Does:
- Create a 3-number draw.
- Commands
- !
- start --> Starts a new draw
- q --> If it exists, the draw will be made from 1 to q, otherwise, 1 to 20
- ]]--
- adm={Hass=true,Wanda=true} --< Change Hass or Wanda and put your name on the spot
- math.randomseed(os.time())
- table.destroy=function(t,k)
- for i,v in pairs (t) do
- if k==v then
- table.remove(t,i)
- break
- end
- end
- end
- table.random=function(t)
- return (type(t)=="table" and t[math.random(#t)] or math.random())
- end
- eventChatCommand=function(n,c)
- if c:sub(1,5)=="start" and adm[n] then
- _G["lim"] = c:sub(7)~="" and tonumber(c:sub(7)) or 20
- time=os.time()+6000
- end
- end
- eventLoop=function()
- if time and os.time()<time then
- local numbers={}
- local sortN={}
- for i = 1,lim do
- table.insert(numbers,i)
- end
- for i = 1,3 do
- local randomNumber=table.random(numbers)
- table.destroy(numbers,randomNumber)
- table.insert(sortN,randomNumber)
- end
- table.sort(sortN,function(a,b) return a<b end)
- for i = 1,3 do
- ui.addTextArea(i,"<font size='20'>"..table.random({"<PT>","<BV>","<R>","<J>","<ROSE>"})..("%02d"):format(sortN[i]),nil,(40*i)+305,360)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement