Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name ApplyForce SOL
- @outputs [Couleurs Alpha Props]:array Etape K1 OK
- @persist [Couleurs Alpha Props]:array Etape K1 OK MULTI:string
- runOnTick(1)
- runOnChat(1)
- if ( first() )
- {
- hint("Tapez !selsol pour demarrer la selection des props qui seront colles au sol.",5)
- Etape = 1
- }
- if ( Etape == 1 & chatClk(owner()) & owner():lastSaid() == "!selsol" )
- {
- hint("Etape 2 Lancee cliquer sur la prop",5)
- Etape = 2
- }
- if ( Etape == 2 & owner():keyAttack1() & !K1 )
- {
- OK = 1
- for(I=1,Props:count())
- {
- if ( owner():aimEntity() == Props:entity(I) ) { OK = 0 }
- }
- if ( OK )
- {
- Props:setEntity(Props:count()+1,owner():aimEntity())
- Couleurs:setVector(Couleurs:count()+1,owner():aimEntity():getColor())
- Alpha:setNumber(Alpha:count()+1,owner():aimEntity():getAlpha())
- owner():aimEntity():setColor(vec(255,255,0),190)
- }
- K1 = 1
- }
- if ( Etape == 2 & chatClk(owner()) & owner():lastSaid() == "!go" )
- {
- hint("GO APPLYFORCE",5)
- for(H=1,Props:count())
- {
- Props:entity(H):setColor(Couleurs:vector(H),Alpha:number(H))
- }
- Etape = 3
- }
- if ( Etape == 3 )
- {
- for(U=1,Props:count()) { Props:entity(U):applyForce(-vec(0,0,MULTI:toNumber())*10*Props:entity(U):mass()) }
- }
- 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) }
- if ( !owner():keyAttack2() ) { K1 = 0 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement