Jump to content

Problem with attaching objects?


Recommended Posts

Posted

At 0.3.7 there was no problems when i attach some object but now when i do it the object stay in same place but i move with empty hands.

mp.events.add('AttachObject', (player,objectHash,bone,x,y,z,rx,ry,rz) => {
    
    if(attachObject != undefined) 
    {
        attachObject.destroy();
    }

        var object = mp.objects.new(objectHash, player.position,
        {
            rotation: new mp.Vector3(0, 0, 0),
            alpha: 255,
            dimension: player.dimension
        });
        
        attachObject =     object;
        let boneID = player.getBoneIndex(bone);
        object.attachTo(player.handle, boneID, x,y,z, rx, ry, rz, true, true, false, false, 0, true);
    

});

 

Posted (edited)
3 hours ago, Xabi said:

Now you have to wait until the object is streamed to attach it.

Well i put while entity... so it wait object to get streamed, now it attach but other players dont see the item?

Edited by Wibes
Posted
On 11/14/2020 at 10:08 AM, Wibes said:

Well i put while entity... so it wait object to get streamed, now it attach but other players dont see the item?

Make sure you synchronize it as you're attaching them clientside, not serverside.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...