Jump to content
Sign in to follow this  
Norm49

Addaction for multiple action

Recommended Posts

I have an addaction script. If i put

fill_water_truck_1 = old_man_water_tank addAction ["Fill up truck with water", {water_truck_1_water_level = 5000}]; it work fine

fill_water_truck_1 = old_man_water_tank addAction ["Fill up truck with water", {playSound "Fountain"}]; it work fine

 

but if i try to have bot action in the same script it give me an error message and only play the sound

fill_water_truck_1 = old_man_water_tank addAction ["Fill up truck with water", {water_truck_1_water_level = 5000 and playSound "Fountain"}]

 

What am I doing wrong?

 

Thanks

Share this post


Link to post
Share on other sites

"and" is a logical operator, which makes no sense here. If you want to run multiple expressions in your code block, you must separate them with semi-colons.

fill_water_truck_1 = old_man_water_tank addAction ["Fill up truck with water", {water_truck_1_water_level = 5000; playSound "Fountain"}];

 

Share this post


Link to post
Share on other sites

It doesn't work it gave me a error message saying ; is missing.

Share this post


Link to post
Share on other sites

Should work fine, but it looks like we've picked up a corrupt/invisible character in our code. This is clean, give it a try:

fill_water_truck_1 = old_man_water_tank addAction ["Fill up truck with water", {water_truck_1_water_level = 5000; playSound "Fountain"}];

 

  • Like 1

Share this post


Link to post
Share on other sites

It did work this time!

I erase everything before punting the new code maybe it help.

 

Thanks

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  

×