yToPzz Posted July 1, 2022 Share Posted July 1, 2022 ERROR: mod\server\gui.lua:26: bad argument #1 to 'pairs' (table expected, got boolean) function syncObjects (player) if isPedInVehicle (player) then local vehicle = getPedOccupiedVehicle(player); for i, v in pairs (getVehicleOccupants(vehicle)) do ---- line 26 triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle)); end end end Link to comment
AngelAlpha Posted July 1, 2022 Share Posted July 1, 2022 (edited) 7 hours ago, yToPzz said: ERROR: mod\server\gui.lua:26: bad argument #1 to 'pairs' (table expected, got boolean) function syncObjects (player) if isPedInVehicle (player) then local vehicle = getPedOccupiedVehicle(player); for i, v in pairs (getVehicleOccupants(vehicle)) do ---- line 26 triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle)); end end end function syncObjects (player) local vehicle = getPedOccupiedVehicle(player); if vehicle then local occupants = getVehicleOccupants(vehicle) if occupants then for i, v in pairs (occupants) do triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle)) end end end end Try this Edited July 1, 2022 by AngelAlpha 1 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now