Advertisement
DoctorX13

AdvancedZonesImplementation

Feb 7th, 2020 (edited)
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. //Script-Implementation Created by Senior S
  2. //Cogito ergo sum :)
  3.  
  4. Zone1 = "Insert_The_name_of_the_zone";
  5. Zone2 = "Insert_The_name_of_the_zone";
  6. //You can add more zones to detect, only add more variables here and add other if to the event OnPlayerChatted!
  7.  
  8. event onPlayerChatted(player, message, chatMode, color, cancel){
  9. ZE1 = "AZ-Enter-" + Zone1 + "-AZ-Implementation";
  10. ZE2 = "AZ-Enter-" + Zone2 + "-AZ-Implementation";
  11. ZL1 = "AZ-Leave-" + Zone1 + "-AZ-Implementation";
  12. ZL2 = "AZ-Leave-" + Zone2 + "-AZ-Implementation";
  13. if(message.contains("AZ-Enter-")){ //This detect when one player enter in any zone!
  14. player.setData("In-AZ-Zone", 1);
  15. cancel = true;
  16. //Insert your code!
  17. }
  18. if(message.contains("AZ-Leave-")){ //This detect when one player enter in any zone!
  19. player.setData("In-AZ-Zone", 1);
  20. cancel = true;
  21. //Insert your code!
  22. }
  23. if(message == ZE1){ //This detect when one player enter in the specific zone!
  24. cancel = true;
  25. //Insert your code!
  26. }
  27. if(message == ZE2){ //This detect when one player enter in the specific zone!
  28. cancel = true;
  29. //Insert your code!
  30. }
  31. if(message == ZL1){ //This detect when one player enter in the specific zone!
  32. cancel = true;
  33. //Insert your code!
  34. }
  35. if(message == ZL2){ //This detect when one player enter in the specific zone!
  36. cancel = true;
  37. //Insert your code!
  38. }
  39. }
  40.  
  41. event onPlayerJoined(player){
  42. player.setData("In-AZ-Zone", 0); //You can use this to check if the player is in a zone!
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement