Need a bit of help plz

im trying to call

function tvRP.playScreenEffect(name, duration)
  if duration < 0 then -- loop
    StartScreenEffect(name, 0, true)
  else
    StartScreenEffect(name, 0, true)

    Citizen.CreateThread(function() -- force stop the screen effect after duration+1 seconds
      Citizen.Wait(math.floor((duration+1)*1000))
      StopScreenEffect(name)
    end)
  end
end

from after this on another script but i dont know how to call it

local smell_choices = {}
smell_choices["Take"] = {function(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil then
    if vRP.tryGetInventoryItem(user_id,"cocaine",1) then
	  vRP.varyThirst(user_id,(20))
	  vRPclient.notify(player,{"~g~ smell cocaine."})
      play_smell(player)
      vRP.closeMenu(player)
    end
  end
end}

any help here would be amazing

Where exactly are you trying to call vRP.playScreenEffect? I don’t see it in your script anywhere

i tryed call client event

ocal smell_choices = {}
smell_choices["Take"] = {function(player,choice)
  local user_id = vRP.getUserId(player)
  if user_id ~= nil then
    if vRP.tryGetInventoryItem(user_id,"cocaine",1) then
	  vRP.varyThirst(user_id,(20))
	  
      vRPclient.notify(player,{"~g~ smell cocaine."})
      play_smell(player)
      vRP.closeMenu(player)
    end
  end
end}
TriggerClientEvent("TakingCocaine", -1)

to here

AddEventHandler("TakingCocaine", takeCocaine)
function takeCocaine()
	tvRP.playScreenEffect(cfg.coma_effect, -1)
end

but that doesnt work

ok i got it to work i was doin it completly wrong

bro tell me how, i got the same problem and im just as new to this xD