Advertisement
Guest User

Event TP Return

a guest
Jul 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. @name Event.TPReturn
  2. @persist [HP,Size] [CurrPlayer]:entity [Players,Weapons]:array
  3. if(first()){
  4. HP = 150 # This is what it sets their health to when they join the event
  5. Size=200
  6. entity():setPos(entity():pos()+vec(0,0,150))
  7. entity():noCollideAll(1)
  8. holoCreate(1,entity():pos()+vec(0,0,owner():height()/2))
  9. holoScaleUnits(1,-vec(Size*2,Size*2,owner():height()))
  10. holoParent(1,entity())
  11. holoVisible(1,players(),0)
  12. holoVisible(1,owner(),1)
  13. runOnChat(1)
  14. timer("DoAction",10000)
  15. }
  16.  
  17. if(chatClk()){
  18. LS = lastSaid():lower():explode(" ")
  19. Txt = LS[1,string]:lower()
  20. Pl = lastSpoke()
  21. if(Txt == "!respawn3"){
  22. if(Pl:team():teamName()=="Citizen"){
  23. Pl["Return",vector] = Pl:pos()
  24. Pl["HPRet",number] = Pl:health()
  25. Pl:teleport(entity():pos()+vec(random(-1*Size,Size),random(-1*Size,Size),0))
  26. Pl:setHealth(HP)
  27. Players:pushEntity(Pl)
  28. }else{
  29. hint(Pl:name()+" tried to join as a "+Pl:team():teamName(),5)
  30. }
  31. }
  32. if(Txt == "!return"){
  33. if(Pl:team():teamName()=="Citizen"){
  34. Pl:teleport(Pl["Return",vector])
  35. Pl:setHealth(Pl["HPRet",number]>0 ? Pl["HPRet",number] : 100)
  36. }else{
  37. print(Pl:name()+" tried to return themselves as a "+Pl:team():teamName())
  38. }
  39. }
  40. }
  41. elseif(clk("DoAction")){
  42. if(Players:count()>0){
  43. if(findCanQuery()){
  44. P=Players:popEntity()
  45. CurrPlayer=P
  46. findClearWhiteList()
  47. findExcludeClass("weapon_physgun")
  48. findExcludeClass("weapon_physcannon")
  49. findExcludeClass("manipulate_bone")
  50. findExcludeClass("prop_physics")
  51. findExcludeClass("gmod_wire_hologram")
  52. findExcludeClass("gmod_wire_expression2")
  53. findExcludeClass("gmod_tool")
  54. findExcludeClass("keys")
  55. findInSphere(CurrPlayer:pos(),25)
  56. Weapons=findToArray()
  57. printTable(findToTable())
  58. timer("StripPerson",500)
  59. }else{
  60. timer("DoAction",500)
  61. }
  62. }else{
  63. timer("DoAction",5000)
  64. }
  65. }elseif(clk("StripPerson")){
  66. if(CurrPlayer:isPlayer()){
  67. if(Weapons:count()>0){
  68. W=Weapons:popEntity()
  69. if(W:isWeapon() && W:type()!="weapon_physgun" && W:type()!="weapon_physcannon" && W:type()!="manipulate_bone"){
  70. W:set("KillHierarchy",0)
  71. }
  72. timer("StripPerson",5)
  73. }else{
  74. timer("DoAction",10)
  75. }
  76. }else{
  77. timer("DoAction",0)
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement