Alpine_gremlin 13 Posted September 22, 2017 Hello guys. So I`ve already made a post about a separate script that I am working on but since I am still a scrub when it comes to writing my own scripts, I am having trouble with this simple one. All it does is create a sandbag wall at the player`s position after five seconds and is called via the AddAction menu. I get the "error missing )" message at line 7. Could anyone tell me where the problem might be? Am I using the sleep command properly? hint "Building Sandbag..."; sleep 5; _time = 5; if (time = 5) then { _newWall = "Land_BagFenceShort" createVehicle (position player); hint "Sandbag built!"; }; EDIT: I changed time = 5 to _time = 5 and am still getting the same error. Share this post Link to post Share on other sites
das attorney 858 Posted September 22, 2017 if (time == 5) then = is for assignation == is for comparison 2 Share this post Link to post Share on other sites
Alpine_gremlin 13 Posted September 22, 2017 7 minutes ago, das attorney said: if (time == 5) then = is for assignation == is for comparison Cheers bro! Share this post Link to post Share on other sites
Alpine_gremlin 13 Posted September 22, 2017 36 minutes ago, das attorney said: if (time == 5) then = is for assignation == is for comparison Oh just one more question: Since it is a multiplayer mission, I would like avoiding broadcasting the hint to everyone except the one player using the addaction at that time (everyone has the option to build). Would you happen to know how I could do this since I`m not using triggers? Share this post Link to post Share on other sites
das attorney 858 Posted September 22, 2017 It shouldn't broadcast anyway if it's done by addaction Share this post Link to post Share on other sites
Alpine_gremlin 13 Posted September 22, 2017 7 minutes ago, das attorney said: It shouldn't broadcast anyway if it's done by addaction Ah okay! Thank you! Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted September 23, 2017 11 hours ago, das attorney said: if (time == 5) then = is for assignation == is for comparison On a side note, time == 5 will most likely never return true, at least last time I checked. You'd be luckier with one of these: round time == 5 //still not recommended time >= 5 //will work In the OPs specific example the if (time>=5) check doesn't make any sense, since the sleep 5 command will guarantee for at least 5 seconds to pass before doing anything past it. Edit: Also depending on the runtime of the mission this check will most likely be true all the time, since time increases during mission runtime. It will only be <= 5 for the first 5 seconds after starting the mission. Cheers 3 Share this post Link to post Share on other sites
das attorney 858 Posted September 23, 2017 Ha ha whoops I didn't even look at the context! My bad, ^^This! 1 Share this post Link to post Share on other sites