Advertisement
Guest User

Untitled

a guest
May 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. @name ApplyForce SOL
  2. @outputs [Couleurs Alpha Props]:array Etape K1 OK
  3. @persist [Couleurs Alpha Props]:array Etape K1 OK MULTI:string
  4.  
  5. runOnTick(1)
  6. runOnChat(1)
  7.  
  8. if ( first() )
  9. {
  10. hint("Tapez !selsol pour demarrer la selection des props qui seront colles au sol.",5)
  11. Etape = 1
  12. }
  13.  
  14. if ( Etape == 1 & chatClk(owner()) & owner():lastSaid() == "!selsol" )
  15. {
  16. hint("Etape 2 Lancee cliquer sur la prop",5)
  17. Etape = 2
  18. }
  19.  
  20. if ( Etape == 2 & owner():keyAttack1() & !K1 )
  21. {
  22. OK = 1
  23. for(I=1,Props:count())
  24. {
  25. if ( owner():aimEntity() == Props:entity(I) ) { OK = 0 }
  26. }
  27.  
  28. if ( OK )
  29. {
  30. Props:setEntity(Props:count()+1,owner():aimEntity())
  31. Couleurs:setVector(Couleurs:count()+1,owner():aimEntity():getColor())
  32. Alpha:setNumber(Alpha:count()+1,owner():aimEntity():getAlpha())
  33. owner():aimEntity():setColor(vec(255,255,0),190)
  34. }
  35. K1 = 1
  36. }
  37. if ( Etape == 2 & chatClk(owner()) & owner():lastSaid() == "!go" )
  38. {
  39. hint("GO APPLYFORCE",5)
  40. for(H=1,Props:count())
  41. {
  42. Props:entity(H):setColor(Couleurs:vector(H),Alpha:number(H))
  43. }
  44. Etape = 3
  45. }
  46. if ( Etape == 3 )
  47. {
  48. for(U=1,Props:count()) { Props:entity(U):applyForce(-vec(0,0,MULTI:toNumber())*10*Props:entity(U):mass()) }
  49. }
  50. if ( Etape == 3 & chatClk(owner()) & owner():lastSaid():explode(" "):string(1) == "!multi" ) { hint("Nouveau multi : -" + owner():lastSaid():explode(" "):string(2),5) MULTI = owner():lastSaid():explode(" "):string(2) }
  51. if ( !owner():keyAttack2() ) { K1 = 0 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement