
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Community Mapper
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!// Rotate entitys
level thread get_rotate_ents();
/*============================== SCRIPT DOC BEGIN ==============================//
REQUIRED: "targetname" = "rotate_ent" // Must be a script_model or a script_brushmodel
REQUIRED: "script_noteworthy" = "DIR" // DIR = Direction - Choose "pitch", "roll", or "yaw"
OPTIONAL: "script_transition_time" = "NUMBER" // NUMBER = Any number you want in seconds. Lower the number = faster rotation. Lowest number is 0.05
OPTIONAL: "script_string" = "needs_power" // Don't add this kvp if you want it to rotate when the game starts
OPTIONAL: "script_sound" = "sound_alias_name" // If you want a sound to play from the ent make sure it's 3D and LOOPING
//=============================== SCRIPT DOC END ===============================*/
get_rotate_ents() {
e_models = GetEntArray("rotate_ent", "targetname");
for(i = 0; i < e_models.size; i++) {
e_models[i] thread handle_rotating_ents();
}
}
handle_rotating_ents() {
if(!isdefined(self.script_noteworthy)) {
return;
}
if(isdefined(self.script_transition_time)) {
time = self.script_transition_time;
}else{
time = 1;
}
if(isdefined(self.script_string) && self.script_string == "needs_power") {
flag_wait("electricity_on"); // wait for power
}
if(isdefined(self.script_sound)) {
self PlayLoopSound( self.script_sound );
}
while (true) {
switch(self.script_noteworthy) {
case "pitch":
self RotatePitch(360, time);
break;
case "yaw":
self RotateYaw(360, time);
break;
case "roll":
self RotateRoll(360, time);
break;
}
wait(time - .1);
}
}