I'm working on a fivem volleyball script 

client.lua

local object_netID = nil
local objectModel = "prop_beach_volball01"
local forwardForceIntensity = 10.0
local upwardForceIntensity = 5.0

local function loadModel(model)
    print("loading")
    local modelHash = GetHashKey(model)
    RequestModel(modelHash)

    while not HasModelLoaded(modelHash) do
        Citizen.Wait(100)
    end
    print('done')
    return modelHash
end

local function spawn_the_ball()
    local player = PlayerPedId()
    local position = GetEntityCoords(PlayerPedId())
    local modelHash = loadModel(objectModel)
    print("createdobject")
    createdObject = CreateObject(modelHash, position.x, position.y, position.z + 1, true, false, true)
    SetEntityDynamic(createdObject, true)
    print("waiting")
    Citizen.Wait(1000)
    local playerRotation = GetEntityRotation(PlayerPedId(), 2)
    local forwardVector = GetEntityForwardVector(PlayerPedId())
    local forceVector = vector3(
        forwardVector.x * forwardForceIntensity,
        forwardVector.y * forwardForceIntensity,
        upwardForceIntensity
    )
    ApplyForceToEntity(createdObject, 1, forceVector.x, forceVector.y, forceVector.z, 0.0, 0.0, 0.0, 0, false, true, true, false, true)
    -- Get the object’s network ID
    local object_netID = ObjToNet(createdObject)
    -- Add this line after setting object_netID
    TriggerServerEvent("VB:setObjectNetworkID", object_netID)
end

RegisterCommand("testing", function()
    spawn_the_ball()
end)

local isInGame = true

local function isPlayerNearObject(object, distanceThreshold)
    local playerCoords = GetEntityCoords(PlayerPedId())
    local objCoords = GetEntityCoords(object)
    local distance = #(playerCoords - objCoords)
    return distance <= distanceThreshold
end

Citizen.CreateThread(function()
    while isInGame do
        Citizen.Wait(0)

        if object_netID then
            local createdObject = NetworkGetEntityFromNetworkId(object_netID)

            if isPlayerNearObject(createdObject, 3.0) and IsControlJustReleased(0, 38) then -- 38 is the key code for "E"
                local playerRotation = GetEntityRotation(PlayerPedId(), 2)
                local forwardVector = GetEntityForwardVector(PlayerPedId())
                local forceVector = vector3(
                    forwardVector.x * forwardForceIntensity,
                    forwardVector.y * forwardForceIntensity,
                    upwardForceIntensity
                )
                ApplyForceToEntity(createdObject, 1, forceVector.x, forceVector.y, forceVector.z, 0.0, 0.0, 0.0, 0, false, true, true, false, true)
            end
        end
    end
end)


RegisterNetEvent("VB:updateObjectNetworkID")
AddEventHandler("VB:updateObjectNetworkID", function(netID)
    object_netID = netID
end)

Citizen.CreateThread(function()
    TriggerServerEvent("VB:requestObjectNetworkID")
end)



server.lua

local QBCore = exports['qb-core']:GetCoreObject()
local object_netID = nil



RegisterServerEvent("VB:setObjectNetworkID")
AddEventHandler("VB:setObjectNetworkID", function(netID)
    object_netID = netID
    TriggerClientEvent("VB:updateObjectNetworkID", -1, netID)
end)

RegisterServerEvent("VB:requestObjectNetworkID")
AddEventHandler("VB:requestObjectNetworkID", function()
    local src = source
    if object_netID then
        TriggerClientEvent("VB:updateObjectNetworkID", src, object_netID)
    end
end)

currently the volleyball will spawn with the /testing command the client that spawned the ball can interacting with it normally IE ApplyForceToEntity but the other client the ball will move for a second on there screen but then tp back to its last position and the orignal client who spawned the object can't see the small glitch