| Author | Message | 
        
			| Mind 
					Joined: Thu Mar 06, 2008 10:54 pm
 Posts: 1360
 Location: USA
   |   LuaWhy does this not work?   Code: function Update(self)for actor in MovableMan.Actors do
 if actor.Team ~= self.Team then
 actor:GibThis()
 end
 end
 end
 
 
 | 
		
			| Wed May 20, 2009 10:59 pm | 
					
					   | 
	
	
		|  | 
	
			| TheLastBanana DRL Developer 
					Joined: Wed Dec 13, 2006 5:27 am
 Posts: 3138
 Location: A little south and a lot west of Moscow
   |   Re: LuaWhat exactly doesn't work with it? 
 
 | 
		
			| Thu May 21, 2009 12:44 am | 
					
					     | 
	
	
		|  | 
	
			| Daman 
					Joined: Fri Jan 26, 2007 3:22 am
 Posts: 1451
   |   Re: LuaI already told him on IRC. He's trying to access a grenade's team. I DON'T THINK SO, TIM. 
 
 | 
		
			| Thu May 21, 2009 1:44 am | 
					
					   | 
	
	
		|  | 
	
			| Mind 
					Joined: Thu Mar 06, 2008 10:54 pm
 Posts: 1360
 Location: USA
   |   Re: LuaIm sure Lord Tim could make a grenade have a team. 
 
 | 
		
			| Thu May 21, 2009 1:45 am | 
					
					   | 
	
	
		|  | 
	
			| Daman 
					Joined: Fri Jan 26, 2007 3:22 am
 Posts: 1451
   |   Re: LuaThe Mind wrote: Im sure Lord Tim could make a grenade have a team.No he couldn't. He could set a variable called self.Team to the nearest actor's team on spawn. That's it(and that's the way to do things like this).
 
 | 
		
			| Thu May 21, 2009 1:48 am | 
					
					   | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: LuaCode: function Create(self)local curdist = 50;
 for actor in MovableMan.Actors do
 local avgx = actor.Pos.X - self.Pos.X;
 local avgy = actor.Pos.Y - self.Pos.Y;
 local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
 if dist < curdist then
 curdist = dist;
 self.parent = actor;
 end
 end
 
 if not MovableMan:IsActor(self.parent) then
 self:GibThis();
 end
 self.Team = actor.Team
 end
 
Done for you. And what if the grenade is an actor?
 
 | 
		
			| Thu May 21, 2009 6:20 am | 
					
					   | 
	
	
		|  | 
	
			| Daman 
					Joined: Fri Jan 26, 2007 3:22 am
 Posts: 1451
   |   Re: LuaIt's not an actor. He said it wasn't.
 Derp.
 
 
 | 
		
			| Thu May 21, 2009 6:42 am | 
					
					   | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: LuaI was talking about making a grenade with a team. 
 
 | 
		
			| Thu May 21, 2009 6:49 am | 
					
					   | 
	
	
		|  | 
	
			| Grif REAL AMERICAN HERO 
					Joined: Sat Jan 27, 2007 10:25 pm
 Posts: 5655
   |   Re: LuaYou can't.
 DERP!
 
 
 | 
		
			| Thu May 21, 2009 11:39 pm | 
					
					   | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: LuaI meant having a actor sprited like a grenade, somehow added into inventory with lua. 
 
 | 
		
			| Fri May 22, 2009 6:32 am | 
					
					   | 
	
	
		|  | 
	
			| Grif REAL AMERICAN HERO 
					Joined: Sat Jan 27, 2007 10:25 pm
 Posts: 5655
   |   Re: LuaHoly ♥♥♥♥ kids.
 AddInventoryItem = AHuman
 CopyOf = Grenade Actor
 
 oh ♥♥♥♥ wow such cool lua
 
 
 | 
		
			| Fri May 22, 2009 2:31 pm | 
					
					   | 
	
	
		|  | 
	
			| mail2345 
					Joined: Tue Nov 06, 2007 6:58 am
 Posts: 2054
   |   Re: LuaI meant so you can add it into actors without having it built in. 
 
 | 
		
			| Sat May 23, 2009 2:49 am | 
					
					   | 
	
	
		|  | 
	
	
		|  |