Jump to content
Sign in to follow this  
kilo1-1

Simple chemlight script not working in multiplayer

Recommended Posts

So I am using a very basic chemlight script to attach a red chemlight to the shoulders of some AI. Here is the code

lgt = "Chemlight_red" createVehicle [0,0,0];   
lgt attachTo [this, [0,-0.03,0.07], "LeftShoulder"]; 

It's a very simple, basic script and works great in the editor/SP. Now when I run my mission on my dedicated server, this chemlight script doesn't seem to work. The AI guys that are supposed to have chemlights on them do not have their chemlights. I am assuming it might have something to do with the createVehicle not working on a dedicated server from a recent patch because I had this script working great on my dedicated server on another mission from a year or so back so it had to have been from a patch where this broke.

Does anyone know how I can get this working again in multiplayer?

Share this post


Link to post
Share on other sites

Should be a global effect, trying wrapping an isServer check around the code.

Share this post


Link to post
Share on other sites

That didn't seem to work. This is what I have. Hopefully, I did it correctly.

if(isServer) then {
lgt = "Chemlight_red" createVehicle [0,0,0];   
lgt attachTo [this, [0,-0.03,0.07], "LeftShoulder"];
};

Share this post


Link to post
Share on other sites

How do You exec/call/spawn that code?

It seems "this" is the wrong variable in this case, try it with "_this" instead.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×