Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chatBox = peripheral.find("chatBox")
- local pDetector = peripheral.find("playerDetector")
- -- chatBox.sendMessage("Welcome friends! <3", "Jadebot", "<>")
- while true do
- local event, username, message, uuid, isHidden = os.pullEvent("chat")
- print("The 'chat' event was fired with the username " .. username .. " and the message " .. message)
- messageTranslate = string.upper(message)
- if messageTranslate == "HI JADEBOT"
- then
- JadeResponse = "Hi " .. username .. "!~"
- chatBox.sendMessage(JadeResponse, "Jadebot", "<>")
- end
- if messageTranslate == "JADEBOT WHERE AM I?"
- then
- playerData = pDetector.getPlayerPos(username)
- JadeResponse = "I think you are in " .. playerData.dimension .. " at " .. "x: " .. playerData.x .. " y: " .. playerData.y .. " z: " .. playerData.z .. "!"
- chatBox.sendMessage(JadeResponse, "Jadebot", "<>")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement