From 756905216b857c102f7f5141dc9ffd2d2701315b Mon Sep 17 00:00:00 2001 From: Zerio Date: Fri, 7 Jun 2024 13:00:37 +0000 Subject: [PATCH] fix: `attempt to index a nil value (field 'options')` --- client.lua | 7 ++++--- server.lua | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client.lua b/client.lua index a0a6501..60fdd16 100644 --- a/client.lua +++ b/client.lua @@ -1318,10 +1318,11 @@ AddEventHandler("pmms:start", function(handle, options) }) end) -AddEventHandler("pmms:play", function(handle) - sendMediaMessage(handle, nil, { +AddEventHandler("pmms:play", function(handle, options) + sendMediaMessage(handle, options.coords, { type = "play", - handle = handle + handle = handle, + options = options }) end) diff --git a/server.lua b/server.lua index 013d13e..6d99d5f 100644 --- a/server.lua +++ b/server.lua @@ -117,7 +117,7 @@ local function addMediaPlayer(handle, options) mediaPlayers[handle] = options enqueue(syncQueue, function() - TriggerClientEvent("pmms:play", -1, handle) + TriggerClientEvent("pmms:play", -1, handle, options) end) end