Skip to content
Black FridayUp to 40% off
Documentation
Props8New Year Props

r_props_newyear Exports & Hooks

New Year Props server export Hold, the onHit server event and the CanHit hook.

Hold (server)

exports.r_props_newyear:Hold(source, 'thunder')
ParameterTypeDescription
sourcenumberThe player.
kindstringthunder, turbo, career, roman, magnum, sparkler, horn or popper.

Puts the firework or party item in the player's hand without an item, for example as a reward or from your own shop. Returns true when it is in the hand. The player lights it like a normal one.

onHit (server event)

AddEventHandler('r_props_newyear:onHit', function(shooter, netId, kind, direct)
    print(('%s hit %s with %s'):format(shooter, netId, kind))
end)
ValueDescription
shooterThe player who fired.
netIdNet id of the player ped, pedestrian or vehicle that was hit.
kindThe firework, for example thunder.
directtrue when the shot landed on it, false when it was near the burst.

Use it for logs, police alerts or fines.

CanHit (hook)

bridge/sv_hooks.lua is open. Return false to stop a hit:

function Hooks.CanHit(src, entity, kind)
    if GetEntityType(entity) == 1 and IsPedAPlayer(entity) then
        return false
    end

    return true
end

This example lets fireworks hit vehicles and pedestrians but never players.