Comment on page
ProjectileHit
Fires when a launched projectile hits something (such as a block or entity)
Example usage:
Events.ProjectileHit(function(event)
-- Only continue if the projectile that hit was Whim's nature spell
if (event.projectileType == "mage_spell_nature") then
local blockAt = BlockService.getBlockAt(event.position)
if (blockAt.blockType == ItemType.DIRT) then
BlockService.placeBlock(ItemType.GRASS, event.position)
ModelService.createModel(ModelType.DAISY, blockAt.position + Vector3.new(0,2.5,0))
end
end
end)
The entity that launched the projectile (may not exist).
The type of projectile that hit.
The position that the projectile hit.
The entity that was hit by the projectile (may not exist).
If set to true, the projectile hit will be cancelled.
Last modified 4mo ago