M4ybe Posted June 18, 2020 Posted June 18, 2020 (edited) my code is exactly the same, apparently this is a bug 1.1 The first entrance to the object and attachment of the object, it is apparently simply created without an attachment. the second creation corrects this until the next transition to the game. @ragempdev Edited June 18, 2020 by M4ybe ragempdev
aLLeN92 Posted June 18, 2020 Author Posted June 18, 2020 The code was attached are inside a function, so this function is called on the command event, try to create the object in a function and calling inside your command event, let me know!
M4ybe Posted June 18, 2020 Posted June 18, 2020 the problem is solved, why didn’t I immediately guess) 1.1 is asynchronous
aLLeN92 Posted June 18, 2020 Author Posted June 18, 2020 Just now, M4ybe said: the problem is solved, why didn’t I immediately guess) 1.1 is asynchronous How you solved? If you can explain maybe works for other people with the same problem!
forestnt Posted July 29, 2020 Posted July 29, 2020 function attachObject(player) { try { if (player && mp.players.exists(player)) { if (attachedObjects[player.id] != undefined) attachedObjects[player.id].destroy(); if (player.getVariable('attachedObject') == null) return; let data = JSON.parse(player.getVariable('attachedObject')); let boneID = player.getBoneIndex(data.Bone); var object = mp.objects.new(data.Model, player.position, { rotation: new mp.Vector3(0, 0, 0), alpha: 255, dimension: player.dimension }); object.attachTo(player.handle, boneID, data.PosOffset.x, data.PosOffset.y, data.PosOffset.z, data.RotOffset.x, data.RotOffset.y, data.RotOffset.z, true, true, false, false, 0, true); attachedObjects[player.id] = object; } } catch (e) { } } Help
Rimeau Posted August 8, 2020 Posted August 8, 2020 Am 4.6.2020 um 14:52 schrieb Xabi: You have to do it clientside, serverside attachment function isn't implemented. Does anybody know if this is ever going to happen? The reason I ask is I would like to use JS server side, but I absolutely need this function.
randzhamiya Posted August 23, 2020 Posted August 23, 2020 В 08.08.2020 в 20:37, Rimeau сказал: Does anybody know if this is ever going to happen? The reason I ask is I would like to use JS server side, but I absolutely need this function. And what does not suit the client?
Rimeau Posted August 29, 2020 Posted August 29, 2020 Am 23.8.2020 um 07:51 schrieb randzhamiya: And what does not suit the client? Not sure what you mean - I would like to attach an entity to an entity on the server side so it's synchronized to all clients, while using JS, but that does not seem to be an option right now
Xabi Posted September 6, 2020 Posted September 6, 2020 6 minutes ago, Ownness said: does anyone have a solution? Wait for the object to be streamed before attaching it.
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