Browse docs

Events

Sky Pets local integration events, observer payloads, item-use entry points, and internal network-event boundaries.

Sky Pets uses local client events for menu coordination and local server/client events for configuration notifications. Listen with AddEventHandler in the indicated runtime. RegisterNetEvent names below are internal transport, not public mutation APIs. For a controlled cross-resource call, prefer Exports.

Local client menu events

EventArgumentsUse
sky_pets:openshopId: stringOpen a configured pet shop; local alias of OpenShop
sky_pets:openSuppliesshopId: stringOpen a configured supplies shop; local alias of OpenSuppliesShop
sky_pets:closeShopnoneClose the active pet/supplies shop
sky_pets:shopStateopen: booleanObserve shop/choice UI opening or closing
sky_pets:wardrobeUpdatedpet: tableLocal wardrobe refresh after an equip/purchase; payload is the updated pet snapshot
sky_pets:wardrobeClosednoneLocal wardrobe state cleanup
sky_pets:leashChangednoneLocal leash state refresh
sky_pets:animal:menuOpeningnoneAnimal-form editor is about to open; pet UI closes

The shopState notification is emitted by the shop flow; use it to pause another local UI. It does not mean a purchase succeeded. OpenShop/OpenSuppliesShop and their local aliases still run the same proximity-validated catalogue flow.

client.lua
AddEventHandler("sky_pets:shopState", function(open)
    if open then
        print("Pet shop UI opened")
    else
        print("Pet shop UI closed")
    end
end)

-- Equivalent to the OpenShop client export.
TriggerEvent("sky_pets:open", "pet_shop")

Local configuration and catalogue notifications

EventRuntimeArgumentsFired when
sky_pets:configUpdatedServer and client separatelychanged: table<string, boolean>Effective managed configuration is applied
sky_pets:breedsChangedServer and client separatelyremoved: table, revision: numberBreed/shop availability is refreshed

These notifications are for observing a change already applied. The client and server each have their own local event bus. Do not trigger them to save settings or register a breed; that bypasses the resource's actual persistence and refresh process.

server.lua
AddEventHandler("sky_pets:configUpdated", function(changed)
    if changed.Shops then
        print("Sky Pets shop configuration was applied")
    end
end)

Inventory item entry points

The configured inventory can invoke sky_pets:useTreat, sky_pets:useBandage, sky_pets:useRescueKit, and the sky_pets:useFood, useFood2, useWater, useBall1useBall3, useBone1useBone2 client events. These are registered by Sky Pets for usable inventory items. They start a local interaction; the server validates state, range and item possession before any reward or consumption. Use the supplied item entries instead of manually triggering these events from another resource.

Internal network events and callbacks

The resource also registers sky_pets:selectedPet, unleash, vehicleRelease, activityCancel, healthDismiss and workCancel on the server; sky_pets:combat, combatEnd, training, health, growth, growthChanged, growthCancelled, workSniff, workResult, configurator sync/open, and sky_pets:animal:* messages on clients. These carry session-specific state and are internal. The sky_pets:* Sky.Cb calls for purchase, wardrobes, needs, combat and the animal editor are likewise internal protocols. External resources should not emit them as shortcuts or trust a client-supplied payload as proof of ownership, payment, duty or combat outcome.