hello, I have prepared a code related to your problem, if your problem persists, you can try this code
--client
local x, y, z = 215.54638671875,2068.0607910156,20
local marker = createMarker(x, y, z, "cylinder", 1.3, 255, 0, 0)
addEventHandler("onClientMarkerHit", marker,
function(hitPlayer, matchingDimension)
if hitPlayer == getLocalPlayer() then
triggerServerEvent("giveWeaponToPlayer", hitPlayer, 23, 250) -- weapon id is 23 and ammo is 250
end
end)
--server
addEvent("giveWeaponToPlayer", true)
addEventHandler("giveWeaponToPlayer", root,
function(weaponID, weaponAmmo)
giveWeapon(client, weaponID, weaponAmmo)
end
)