Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chatBack = peripheral.wrap("back")
- rednet.open("left")
- function floodPlayer(playerFrom, playerTo, msg, times)
- for i = 1, #times do
- chatBack.tell(player, msg)
- sleep(1)
- end
- tellPlayer(playerFrom, "Success")
- logPrint("flood", playerFrom, playerTo, msg)
- return true
- end
- function floodAll(playerFrom, msg, times)
- for i = 1, #times do
- chatBack.say(msg)
- sleep(1)
- end
- tellPlayer(playerFrom, "Success")
- logPrint("flood", playerFrom, "everybody", msg)
- return true
- end
- function logPrint(event, playerFrom, playerTo, msg)
- if event == "flood" then
- print(playerFrom.." flooded "..playerTo.. "with the message:")
- print(string.rep("-"), 51)
- print(msg)
- print(string.rep("-"), 51)
- end
- end
- function tellPlayer(player, msg)
- chat.tell(player, msg)
- end
- function main()
- local event, side, player, msg = os.pullEvent("chatbox_command")
- command = {}
- for v in chatMsg:gmatch("[^ ]+") do
- table.insert(command, v)
- end
- if player == "smigger22" or player == "RodrickLord" or player == "jasperdekiller" then
- if command[1] == "flood" then
- if command[2] == "all" then
- floodAll(player, command[3], command[4])
- elseif command[2] ~= "all" then
- if command[2] == "smigger22" or command[2] == "RodrickLord" or command[2] == "jasperdekiller" then
- tellPlayer(player, "You can't flood this user!")
- elseif command[2] ~= "smigger22" or command[2] ~= "RodrickLord" or command[2] ~= "jasperdekiller" then
- floodPlayer(player, command[2], command[3], command[4])
- end
- end
- end
- end
- end
- while true do
- main()
- end
Advertisement
Add Comment
Please, Sign In to add comment