User Tools

Site Tools


script:world_event:spawnprojectile

spawnProjectile

  • 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: numberdestination of the thrown object
    • speed: numberThrowing speed
  • Return value and type:
    • code: numberSuccess (ErrorCode.OK) ErrorCode
    • objid: numberThe instance ID of the thrown object
  • The main function of this method is to generate projectiles
  • The specific use cases are as follows:
local code, objid = World:spawnProjectile(shooter, itemid, x, y, z, dstx, dsty, dstz, speed)
if code == ErrorCode.OK then
print('Execution success', code, objid )
else
print('Execution failed')
end
script/world_event/spawnprojectile.txt · Last modified: 2024/06/09 07:55 by don