Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FakeChat SERVER
- --
- -- Unencrypted, but fun!
- -- Spoof chat messages from anyone!
- -- Use with responsibility.
- if not commands then
- error("This requires a command computer.")
- end
- local modem = peripheral.find("modem")
- if not modem then
- error("A modem is required.")
- end
- modem.open(1251)
- shell.run("cf") --Function for translating messages into something commands.tellraw() can work with
- local players = { --Add playernames here if you want to filter who receives messages
- "dan200",
- }
- local doFilter = false --If false, filters according to 'players' table
- local send = function(name,msg)
- local compiled --compiled message, not compiled program
- if msg:sub(1,3) == "___" then
- compiled = msg:sub(4)
- else
- compiled = "<"..name.."&r> "..msg
- end
- compiled = colorFormat(compiled)
- if doFilter then
- for a = 1, #players do
- commands.tellraw(players[a],compiled)
- end
- else
- commands.tellraw("@a",compiled)
- end
- end
- while true do
- local evt = {os.pullEvent("modem_message")}
- if type(evt[5]) == "table" then
- if type(evt[5][1]) == "string" and type(evt[5][2]) == "string" then
- send( evt[5][1], evt[5][2] )
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement