02-22-2011, 16:59
Hello, I have a problem. I create bots but they fly, I think it comes from this order. If someone could make me walk? Pls
Quote:ClampToGround()
{
self endon("bot_death");
self endon("crate_gone");
while(1)
{
trace = bulletTrace(self.origin + (0,0,50), self.origin + (0,0,-40), false, self);
if(isdefined(trace["entity"]) && isDefined(trace["entity"].targetname) && trace["entity"].targetname == "bot")
trace = bulletTrace(self.origin + (0,0,50), self.origin + (0,0,-40), false, trace["entity"]);
self.origin = (trace["position"]);
self.currentsurface = trace["surfacetype"];
if(self.currentsurface == "none")
self.currentsurface = "default";
wait .5;
}
}