PDA

View Full Version : how to made fans spin ?



markoffxi
August 9th, 2013, 11:56
hi all in my second map I'm still working on I've made some ceiling fans and was wondering how easy would it be to made then spin round ?............... cheers markoff

BU|D-ToX
August 9th, 2013, 14:54
Use this as an example. http://www.codutility.com/downloads.php?do=file&id=2272

If you get stuck, we had a destructible spinning ceiling fan in Rundown as well. I'd have to look for them but I'm sure I have the files somewhere. Try working it out on your own first using the AC fan as a guide.

markoffxi
August 9th, 2013, 16:05
thank you but what am I looking for in there and where is it lol...................

BU|D-ToX
August 9th, 2013, 22:13
raw/maps/mp/ac_fan_script.gsc


main()

{
thread acspin();
}

acspin()
{
acfan = getentarray("acfan", "targetname");
for(i = 0; i < acfan.size; i++)
acfan[i] thread fanrotate(0.4);
}
fanrotate(speed)
{
if (!isdefined(self.script_noteworthy))
self.script_noteworthy = "x";
while(1)
{
if (self.script_noteworthy == "x")
self rotatepitch(360,speed);
wait(speed - 0.1);
}
}


This is what makes it spin, however using the ac fan as a guide will help you figure out how to incorporate it properly. I'll PM you a link to a worth while tut.