daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @name Chikken's Targetting E2
  2. @inputs
  3. @outputs X Y Z Pos:vector Fire
  4. @persist Target:entity
  5. @trigger
  6.  
  7. if (clk()) {
  8.     if (Target) {
  9.         X = Target:pos():x()
  10.         Y = Target:pos():y()
  11.         Z = Target:pos():z()
  12.         Pos = Target:pos()
  13.     }
  14.    
  15.     interval(100)
  16. }
  17. elseif(chatClk(owner())){
  18.     if(lastSaid():left(1) == "/"){
  19.         hideChat(1)
  20.         Chat = lastSaid():explode(" ")
  21.         Cmd = Chat[1,string]:sub(2)
  22.        
  23.         if(Cmd == "target") {
  24.             if (findCanQuery()) {
  25.                 Target = findPlayerByName(Chat[2,string])
  26.                
  27.                 if (!Target) {
  28.                     printColor(vec(50,100,200), "E2: ", vec(255,255,255), "Target not found.")
  29.                 }
  30.                 else {
  31.                     printColor(vec(50,100,200), "E2: ", vec(255,255,255), "Targeted " + Target:name() + ".")
  32.                     X = Target:pos():x()
  33.                     Y = Target:pos():y()
  34.                     Z = Target:pos():z()
  35.                     Pos = Target:pos()
  36.                 }
  37.             }
  38.             else {
  39.                 printColor(vec(50,100,200), "E2: ", vec(255,255,255), "Failed to find.")
  40.             }
  41.         }
  42.         elseif (Cmd == "clear" | Cmd == "untarget") {
  43.             Target = noentity()
  44.             printColor(vec(50,100,200), "E2: ", vec(255,255,255), "Cleared Target.")
  45.         Fire = (0)
  46.         }
  47.         elseif (Cmd == "fire") {
  48.             printColor(vec(50,100,200), "E2: ", vec(255,255,255), "Fire!")
  49.        Fire = (1)
  50.      }
  51.     }
  52. }
  53. elseif (first() | duped()) {
  54.     runOnTick(1)
  55.     runOnChat(1)
  56.     Target = owner()  
  57.     interval(100)
  58. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top