Installation process:
Standalone Server (cfx default)
Installed both ox_lib and interact
They are both ran on startup
My code (client-side):
local hash = "prop_vend_snak_01"
-- Requesting Model so it can be spawned
RequestModel(hash)
while not HasModelLoaded(hash) do
Wait(500)
end
-- get nearest vehicle to player
local entityId = CreateObject(hash, coordsx, coordsy, coordsz - 1.0, true, true, true)
local networkId = NetworkGetNetworkIdFromEntity(entityId)
-- Test command to add interact to the entity
RegisterCommand("lynspawn", function()
exports.sleepless_interact:removeEntity("uniqueNetworkedEntityId")
interact.addEntity({
id = "uniqueNetworkedEntityId",
netId = networkId, -- Example network ID
options = {
{
label = "Networked Interact Option",
icon = "hand", -- Example simple FA icon name
onSelect =function(data) print("Networked entity action triggered") end,
canInteract = function(entity, distance, coords, id)
return true
end
},
},
renderDistance = 10.0,
activeDistance = 2.0,
cooldown = 1500
})
end)
As you can see, I removed item and group requirement just in case (testing on fully standalone server)
Interact doesn't show up on the object after using this command. There are no errors in client/server consoles
![image](https://github.com/user-attachments/assets/30e3fa25-1c9c-4a72-919e-4bc6c82cfec3)
Installation process: Standalone Server (cfx default)
-- Requesting Model so it can be spawned RequestModel(hash) while not HasModelLoaded(hash) do Wait(500) end -- get nearest vehicle to player local entityId = CreateObject(hash, coordsx, coordsy, coordsz - 1.0, true, true, true) local networkId = NetworkGetNetworkIdFromEntity(entityId)
-- Test command to add interact to the entity RegisterCommand("lynspawn", function() exports.sleepless_interact:removeEntity("uniqueNetworkedEntityId") interact.addEntity({ id = "uniqueNetworkedEntityId", netId = networkId, -- Example network ID options = { { label = "Networked Interact Option", icon = "hand", -- Example simple FA icon name onSelect =function(data) print("Networked entity action triggered") end, canInteract = function(entity, distance, coords, id) return true end }, }, renderDistance = 10.0, activeDistance = 2.0, cooldown = 1500 }) end)