Help with peds not standing on ground

how do you make the shop peds stand on the ground when adding them trying to use peds as the shop keeper. so i can 3rd eye

Subtract 1 from from the z value.

If using vec3: Vec3(3.5, 2.4, 2.7) it should be vec3(3.5, 2.4, 1.7)

If vec4: vec4(3.5, 2.4, 2.7, 5.0) it should be vec4(3.5, 2.4, 1.7, 5.0)

The coordinate is taken from the center of your body. Some resources automatically add -1 to the height, but that’s rare.

witch one is the z value il upload the file i’m new to developing

also is there an easier way then having to do one shop at a time i wanna make all shops have peds i’m using ox inv with this hope someone has a file already made that i can use haha
shops 1.lua (6.5 KB)

thanks heaps

Can’t access it right now, but look at the two vec values I gave you: 2.7 to 1.7.

It’s vec3(x, y, z) and vec4(x, y, z, h) with h being heading/direction the ped faces. You want to lower z by 1.

Ok thank you

i tryed it dident work this is what it is loc = vec3(1727.6409, 6415.7744, 35.0372),

change the last number, so 35.0372 to 34.0372

it worked thank you is there an Ezy way then doing it one by one?

hmm there may be one, but just do it better like this because its not that much effort.

this is what im using but i can only do it for one shop how can i do it for all shops

	name = 'Shop',
	blip = {
		id = 59, colour = 69, scale = 0.8
	}, inventory = {
		{ name = 'burger', price = 10 },
		{ name = 'water', price = 10 },
		{ name = 'cola', price = 10 },
	}, locations = {
		vec3(25.7, -1347.3, 29.49),
		vec3(-3038.71, 585.9, 7.9),
		vec3(-3241.47, 1001.14, 12.83),
		vec3(1728.66, 6414.16, 35.03),
		vec3(1697.99, 4924.4, 42.06),
		vec3(1961.48, 3739.96, 32.34),
		vec3(547.79, 2671.79, 42.15),
		vec3(2679.25, 3280.12, 55.24),
		vec3(2557.94, 382.05, 108.62),
		vec3(373.55, 325.56, 103.56),
	}, targets = {
	      {

            loc = vec3(25.06, -1347.32, 29.5),
            length = 0.7,
            width = 0.5,
            heading = 0.0,                                          
            minZ = 29.5,                               
            maxZ = 29.9,
            distance = 1.5
        },
        -- Shop using a ped
        {
            ped = `mp_m_shopkeep_01`,
            scenario = 'WORLD_HUMAN_AA_COFFEE',
            loc = vec3(1727.6409, 6415.7744, 34.0372),                                         
            heading = 242.0,ance = 1.5 },

Just do it one by one. It’s a one time thing.

every time i try i get errors. i dk how to fix do you have a config that i can use so i know what im doing wrong

Replace:

loc = vec3(1727.6409, 6415.7744, 34.0372), 

with

loc = vec3(1727.6409, 6415.7744, 33.0372), 

i got that part working its now adding the other shops ped loc not sure how i do that cant find any info about it i have about 10 more shops that need peds

it depends on how your script is working, does it support multiple shops, if yes, you have to seperate them with commas from each other.

I assume you’re using ox_inventory? They have documentation.

If you wanted multiple hopsit would look like:

            {
                ped = `mp_m_shopkeep_01`,
                scenario = 'WORLD_HUMAN_AA_COFFEE',
                loc = vec3(24.407, -1347.283, 28.497),
                heading = 270.311,
            },
            {
                ped = `mp_m_shopkeep_01`,
                scenario = 'WORLD_HUMAN_AA_COFFEE',
                loc = vec3(24.407, -1347.283, 28.497),
                heading = 270.311,
            },
            {
                ped = `mp_m_shopkeep_01`,
                scenario = 'WORLD_HUMAN_AA_COFFEE',
                loc = vec3(24.407, -1347.283, 28.497),
                heading = 270.311,
            },
            {
                ped = `mp_m_shopkeep_01`,
                scenario = 'WORLD_HUMAN_AA_COFFEE',
                loc = vec3(24.407, -1347.283, 28.497),
                heading = 270.311,
            },

Obviously, you need to change the loc = to another vec3.

Heading would be the fourth value in vec4, the direction the ped is looking towards.

You’re having errors because of your formatting.

shops.lua (6.6 KB)
here is the file can you make one up for me like 2 shop peds so i can see how its done

so what exactly you wanna do? I can see that the “Shop” has multiple locations so there are several shops, or you want to have another type of shop?

yes that’s what im after thank you so much coud i have your file so its easier haha

i want to add peds to all those other shops