unidad2pete 10 Posted June 7, 2013 Hi; I want an action to repair buildings. Init player: player addAction ["Repair Building", "repairbuild.sqf"]; repairbuild.sqf: _rbuilding = nearestBuilding player; _rbuilding setdamage 1; sleep 2; _rbuilding setdamage 0; The script works fine, my problem is that it only detects the default map buildings, if I add a building to the map, (with @ deditor or @ CJTFEditor) is not detected as a building, I do not know why. any help? Share this post Link to post Share on other sites
mantls 2 Posted June 7, 2013 (edited) Try _buildings = nearestobjects [player,["House"],5]; _rBuilding = _buildings select 0; This should choose the closest Building. However, you might want to try adding addActions to all buildings in for example your init.sqf to avoid uncertainties. Edited June 7, 2013 by mantls Share this post Link to post Share on other sites
unidad2pete 10 Posted June 7, 2013 Good idea!! adding addActions to buildings works fine!! Thank you!! Now, my problem is add cooldown to player for repair other building, any idea? Share this post Link to post Share on other sites
Zlin 10 Posted August 27, 2013 (edited) I just tried this script because I was wanting something like it as well but I get undefined variable errors. What am I doing wrong? I created the repairbuild.sqf just as is presenting above. ??? edit: Nevermind.. I figured out my issue. I had to save my test mission in the editor first. Just previewing without saving wasn't changing anything. Thanks!!! Edited August 27, 2013 by Zlin Share this post Link to post Share on other sites
Kasper Rasmussen 0 Posted May 23, 2017 please upload repairbuild.sqf Share this post Link to post Share on other sites
Midnighters 152 Posted May 24, 2017 so why exactly can't anybody figure out how to replicate this script? There is plenty of information here. Share this post Link to post Share on other sites