Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rainbowNames = {}
- local nameColors = {"EB0C0C","EB790C","EBE70C","0DEB0C","0CC2EB","214AED","B221ED"}
- system.disableChatCommandDisplay("rainbow", true)
- function eventLoop()
- if #rainbowNames >= 1 then
- for i,v in next, rainbowNames do
- tfm.exec.setNameColor(v,"0x"..nameColors[math.random(#nameColors)])
- end
- end
- end
- function string.split(s, pattern, n)
- local st = {}
- for sb in string.gmatch(s, "[^"..pattern.."]+") do
- if not n or n > -1 then
- table.insert(st,sb)
- else
- st[#st] = st[#st]..pattern..sb
- end
- n = n and n-1 or false
- end
- return st
- end
- function eventChatCommand(playerExecuted, command)
- args = string.split(command, " ")
- if string.upper(args[1]) == "RAINBOW" then
- if args[2] and string.upper(args[2]) == "ON" then
- if args[3] and tostring(args[3]):sub(-5,-5) == "#" then
- table.insert(rainbowNames,args[3])
- end
- elseif args[2] and args[3] and string.upper(args[2]) == "OFF" then
- for i, v in next, rainbowNames do
- if v == args[3] then
- rainbowNames[i] = nil
- break
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment