ProjectileHit
Fires when a launched projectile hits something (such as a block or entity)
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)Parameters
shooter: Entity | nil
projectileType: ProjectileType
position: Vector3
hitEntity: Entity | nil
cancelled: bool [modifiable]
Last updated