DamonSalvatore Posted December 28, 2020 Share Posted December 28, 2020 (edited) Hello guys, i have a problem.I can't attach a gas can in user hands. The object stay's in the air. I have this code in client_packages let bone = mp.players.local.getBoneIndex = 24818; position = new mp.Vector3(-0.1, -0.15, 0.11); rotation = new mp.Vector3(-180.0, 0.0, 0.0); let obj = mp.objects.new(242383520, mp.players.local.position, { rotation: new mp.Vector3(0, 0, 0), alpha: 255, dimension: mp.players.local.dimension }); obj.attachTo(mp.players.local.handle, bone, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, true, false, false, false, 2, false); What can i do next? Please with the example Edited December 28, 2020 by DamonSalvatore Link to comment Share on other sites More sharing options...
Xabi Posted December 29, 2020 Share Posted December 29, 2020 That created object has a property called notifyStreaming that you can set to true. This way the object will call the entityStreamIn event when it's created, so you can attach it to the player. 1 Link to comment Share on other sites More sharing options...
DamonSalvatore Posted December 29, 2020 Author Share Posted December 29, 2020 1 hour ago, Xabi said: That created object has a property called notifyStreaming that you can set to true. This way the object will call the entityStreamIn event when it's created, so you can attach it to the player. You can give a example? Because i don't understand what to do in entityStreamIn Link to comment Share on other sites More sharing options...
Xabi Posted December 29, 2020 Share Posted December 29, 2020 15 minutes ago, DamonSalvatore said: You can give a example? Because i don't understand what to do in entityStreamIn Just call the attachTo method there. 1 Link to comment Share on other sites More sharing options...
DamonSalvatore Posted December 29, 2020 Author Share Posted December 29, 2020 1 hour ago, Xabi said: Just call the attachTo method there. mp.events.add('entityStreamIn', (obj) => { var bone = mp.players.local.getBoneIndex(18905); position = new mp.Vector3(-0.125, -0.1, 0.11); rotation = new mp.Vector3(20, 0, -15); obj.attachTo(mp.players.local.handle, bone, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, true, false, false, false, 2, false); }); But when i spawn a vehicle, the vehicle will follow player Link to comment Share on other sites More sharing options...
Shourya90 Posted January 10, 2021 Share Posted January 10, 2021 On 12/29/2020 at 6:43 PM, DamonSalvatore said: mp.events.add('entityStreamIn', (obj) => { var bone = mp.players.local.getBoneIndex(18905); position = new mp.Vector3(-0.125, -0.1, 0.11); rotation = new mp.Vector3(20, 0, -15); obj.attachTo(mp.players.local.handle, bone, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, true, false, false, false, 2, false); }); But when i spawn a vehicle, the vehicle will follow player use > if(obj == yourobj) Link to comment Share on other sites More sharing options...
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