I pretty much revised the entire script:
@name RPG_Missile
@inputs Fire Indicator:entity Model:entity Target:entity TargetV:vector Reload
@outputs IsFired
@persist Missile:entity Target:entity TargetS:string LastSaidL:string Said TargetPos:vector X Y Z XYZ
@trigger all
interval(1000)
Gate=entity()
LastSaidL=owner():lastSaid():lower()
if (LastSaidL:sub(1,8)=="/target") {
TargetS=LastSaidL:sub(9, LastSaidL:length())
}
if (TargetS!=""){
Target=findPlayerByName(TargetS)
Said=0
}
#by Jackorobot/Bayangan
#type /target [name]
if (Target:isPlayer()==1 & Said==0){
print("Target acquired "+Target:name())
Indicator:setColor(0, 255, 0)
Said=1
}
TargetPos=Target:pos()
TargetPosN=TargetPos:normalized()
#X=TargetPos:x()
#Y=TargetPos:y()
#Z=TargetPos:z()
#XYZ=X Y Z
if (~Fire & IsFired==0) {
Missile=propSpawn(Model, 0)
IsFired=1
Fire=0
}
if (IsFired==1) {
timer("Delay", 500)
Missile:applyForce( TargetPosN+random(1, 5))
}
if (IsFired==1 & ~Reload) {
IsFired=0
}
The problem is that I cannot seem to put a vector(normalized) in to the parameters aswell as a force. Any ideas? I need 'em.