Clothing / appearance
Client Hide only hides slings on that screen (clothing camera). Other players still see the networked prop. Server Hide(src) tells every client to hide that player.
This client only
Use this when only the player looking at the menu should lose the sling (local camera / NUI). Other players still see it on them.
AddEventHandler('your_clothing:opened', function()
exports.n_sling:Hide()
end)
AddEventHandler('your_clothing:closed', function()
exports.n_sling:Show()
end)Whole server
Use this when everyone should stop seeing that player's slings (shared appearance room, photos, etc.).
-- server
AddEventHandler('your_clothing:opened', function(src)
exports.n_sling:Hide(src)
end)
AddEventHandler('your_clothing:closed', function(src)
exports.n_sling:Show(src)
end)Cutscene (one client's view)
Hides every sling on that client's screen (themselves + other players), then brings them back.
-- server
exports.n_sling:HideAll(source)
-- later
exports.n_sling:ShowAll(source)Inventory changed
After you add / remove a slung item from a player, rebuild the worn list:
-- server
exports.n_sling:Refresh(source)Do not write Player(src).state.n_sling yourself unless you intend to replace the worn list.