Advertisement
BobMe

basic find player system

Jan 17th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function findplayer(playername)
  2. plrlen = string.len(playername)
  3. Current_Players = {"Memo1332","heccBeccKecc","HeccaBiggay25","Oof_Doof2"}
  4. for i=1,#Current_Players do
  5. plr = Current_Players[i]
  6. if plr:sub(1,plrlen):lower() == playername:lower() then
  7. return Current_Players[i]
  8. end
  9. end
  10. end
  11.  
  12. msg = "<get/m/AOB"
  13.  
  14. if msg:sub(2,5) == "get/" then
  15. for i=6,99,1 do
  16. if msg:sub(i,i) == "/" then
  17. kek = i
  18. break
  19. end
  20. end
  21. player_name = findplayer(msg:sub(6,kek-1))
  22. message = msg:sub(kek+1)
  23. print("Got "..player_name.." with message: "..message)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement