User Tools

Site Tools


script:world_event:spawnprojectilebydir

spawnProjectileByDir

  • Parameters and types:
    • shooter: numberSet the objid to which the thrown object belongs
    • itemid: numberthrowable id
    • x,y,z: numberstarting point of the thrown object
    • dstx, dsty, dstz: numberthrowing direction
    • speed: numberThrowing speed
  • Return value and type:
    • code: numberSuccess (ErrorCode.OK) ErrorCode
    • objid: numberThe instance ID of the thrown object
  • The main purpose of this method: Generate projectiles (by direction)
  • The specific use cases are as follows:
local code, objid = World:spawnProjectileByDir(shooter, itemid, x, y, z, dirx, diry, dirz, speed)
if code == ErrorCode.OK then
print('Execution success', code, objid )
else
print('Execution failure')
end
script/world_event/spawnprojectilebydir.txt · Last modified: 2024/06/09 07:58 by don