Globals
source
Section titled “source”Type: integer?. Server and client.
ID of the player who sent the network event that is being handled.
Only set while a network event handler runs; nil otherwise. Copy it into a local variable before calling Wait, because another event can change it.
RegisterNetEvent('myshop:buy', function(itemId) local player = source Wait(100) TriggerClientEvent('myshop:bought', player, itemId)end)