smigger22

JSON name adder

Apr 8th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function printUsage()
  2. print("Usage: " .. shell.getRunningProgram() .. " <player> <join:leave>")
  3. end
  4.  
  5. tArgs = { ... }
  6. if #tArgs == 2 then
  7. if tArgs[2] == "join" then
  8. commands.exec('tellraw @p ["",{"text":"' ..tArgs[1] .. ' joined the game","color":"yellow"}]')
  9. elseif tArgs[2] == "leave" then
  10. commands.exec('tellraw @p ["",{"text":"' ..tArgs[1] .. ' left the game","color":"yellow"}]')
  11. else
  12. printUsage()
  13. end
  14. else
  15. printUsage()
  16. end
Advertisement
Add Comment
Please, Sign In to add comment