Inumel

chat commands

May 20th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. cmd = peripheral.wrap("left")
  2. chat = peripheral.wrap("right")
  3. while true do
  4.   local event, player, message, side = os.pullEvent("endernet_chat_message")
  5.   if message:sub(1,12):lower() == "teleport to " then
  6.     x = message:sub(13,#message)
  7.     cmd.setCommand("tpx "..player.." "..x)
  8.     cmd.runCommand()
  9.     print("Teleported: "..player.."to: "..x)
  10.   end
  11.   if message:sub(1,12):lower() == "take me home" then
  12.     cmd.setCommand("tpx "..player.." 0 218 41 358")
  13.     cmd.runCommand()
  14.     print("Teleported: "..player.." Home successfully")
  15.   end
  16.   if message:sub(1,5):lower()=="time " then
  17.     cmd.setCommand("time set "..message.." 0")
  18.     cmd.runCommand()
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment