Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

giveComponent not exist in WeaponObject #310

Open
1 task done
BluePeer opened this issue Dec 3, 2023 · 2 comments
Open
1 task done

giveComponent not exist in WeaponObject #310

BluePeer opened this issue Dec 3, 2023 · 2 comments
Labels
scope: client Clientside module related issues type: bug Something isn't working

Comments

@BluePeer
Copy link

BluePeer commented Dec 3, 2023

Description of the problem

the giveComponent from WeaponObject does not exist

Reproduction steps

async function test() {
let ppos = alt.Player.local.pos;
let npos = new alt.Vector3(ppos.x,ppos.y,ppos.z + 1);
const w = new alt.WeaponObject(3220176749,npos,new alt.Vector3(0,0,0));
await w.waitForSpawn();
w.frozen = true;
await alt.Utils.wait(5000);
w.giveComponent(3689981245);

await alt.Utils.wait(5000)
w.destroy();
}

Expected behaviour

giveComponent be a part of WeaponObject

Additional context

try to confirm this issue on Dev, but the current dev client does not Start (crash)
so i posted it to not forget

Operating system

Win/Linux

Version

release

Scope

client

Reproduction tested

  • I confirm that I have made sure that this issue is also present on the newest dev version
@BluePeer BluePeer added the type: bug Something isn't working label Dec 3, 2023
@xLuxy xLuxy added the scope: client Clientside module related issues label Dec 30, 2023
@BluePeer
Copy link
Author

Note Update: The whole thing currently works once, but when you try to use it a second time the function is unknown again.

@BluePeer
Copy link
Author

BluePeer commented Apr 18, 2024

Worked Today a Little more on this

i found out some suspect stuff

first every with alt.WeaponObject created Weapon
is on First create
instanceof WeaponObject and LocalObject Positive
on Second Create Only Positive on LocalObject

tested this many times with 20 weapon hashes (like the code above exclude the givecomponent part

Now the suspect part Beginns

All Test Rounds starting with a Clean Client start
the only change now is to call this before the create test

alt.on("baseObjectCreate",(entity) => {
if (entity instanceof alt.WeaponObject) alt.log("BaseObjectCreate is WeaponObject " + entity.hash);
if (entity instanceof alt.LocalObject) alt.log("BaseObjectCreate is LocalObject" + entity.hash);
});

If i do this Before the create
All are Instant LocalObject never WeaponObject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: client Clientside module related issues type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants