Jump to content
Sign in to follow this  
sgtelis

Why does this code not work?

Recommended Posts

It worked yesterday and now all by a sudden none of the if:s work anymore... It was part of another script and I tried move it around and even putting it in a solo script and still doesn't work.

Can anyone help me out?

_target = _this select 0;
_caller = _this select 1;

_lie = "willLie";

if(side _caller == west) then{

	_caller sideChat "Hello sir. Have you seen anything suspicious today?";
	sleep 1;

	if(_lie == "willLie") then{
		_target switchMove "HudBriefing_think";
		sleep 1;
		_say = ["civNo1","civNo2","civNo3"] call BIS_fnc_selectRandom;
		_target directSay _say;
		sleep 2;
		_caller sideChat "Ok, have a nice day then."
		sleep 1;
	} else {
		_say = ["civYes1","civYes2","civYes3"] call BIS_fnc_selectRandom;
		_target directSay _say;
		_target switchMove "HudBriefing_pointLeft";
		_mark setMarkerAlpha 1;
		hint "A civilian has tipped the hunted off.\nMap Updated...";
		sleep 1;
	};
};

_lie is set from another script and work as it should.

Share this post


Link to post
Share on other sites

You're missing a ; here, it might break the whole script?

 

        _caller sideChat "Ok, have a nice day then."

Share this post


Link to post
Share on other sites

Oh, snap.

You are right!

And I who thought I looked so closely... :P

I'll check on it tomorow and see if that fixes it (believe it should) since I got the project on another pc.

 

Ty mate :)

Share this post


Link to post
Share on other sites

Oh, snap.

You are right!

And I who thought I looked so closely... :P

I'll check on it tomorow and see if that fixes it (believe it should) since I got the project on another pc.

 

Ty mate :)

If you use showScriptErrors in your launch params it will tell you the location and reason for errors like that(mostly) https://community.bistudio.com/wiki/Arma_3_Startup_Parameters

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  

×