I made a cool Harpoon Gun in expression 2 yesterday. You can download it at Harpoon Gun Download! .
Or just copy and paste it from here.
Controls: E = Pick up prop you're looking at. | Mouse1 = Shoot prop. | Mouse2 = Bring prop back.
Code:@name Harpoon Gun @persist Me:entity E:entity Use Mouse1 Mouse2 V:vector V2:vector Gyro:angle Holding runOnTick(1) Me = owner() Use = Me:keyUse() Mouse1 = Me:keyAttack1() Mouse2 = Me:keyAttack2() P = E:elevation(Me:aimPos()) Y = E:bearing(Me:aimPos()) R = E:angles():roll() Gyro = -ang(P,Y,R)*E:mass()*10 V = ((Me:pos() + vec(0,0,65) + Me:eye()*120) - (E:pos()))*E:mass()*2 if (Use & $Use) { Holding = !Holding if (Holding == 1) { E = Me:aimEntity() } } if (Holding == 1) { E:applyForce(V + $V*5) E:applyAngForce(Gyro + $Gyro*5) E:setAlpha(200) }else{ E:setAlpha(255) } if (Holding == 1 & Mouse1) { Holding = 0 E:applyForce(Me:eyeAngles():forward()*90000000000000000000000) E:setMass(1) } if (Holding == 0 & Mouse2) { Holding = 1 E:applyForce(V + $V*5) E:applyAngForce(Gyro + $Gyro*5) E:setAlpha(200) E:setMass(50) } E:setMass(50)
Bookmarks