dennis Posted February 19, 2015 Share Posted February 19, 2015 Heya guys, I have a problem with the genericai script from imchaseinyou It keeps on shooting through walls... How can I fix this? Thanks in common, Dennis Quote Link to comment Share on other sites More sharing options...
epsilonion Posted February 24, 2015 Share Posted February 24, 2015 I have this problem as well.. Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 25, 2015 Share Posted February 25, 2015 probably could check to see what it picks if it is the player or not, if it isn't then it shouldn't cause damage to the player. Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
dennis Posted February 26, 2015 Author Share Posted February 26, 2015 it's referring to a distancetopoint, and I am getting attacked! the problem is that I only can stop the attack when I'm out of attack range Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 26, 2015 Share Posted February 26, 2015 it's referring to a distancetopoint, and I am getting attacked! the problem is that I only can stop the attack when I'm out of attack range i know a way to remedy this is to use a pick to see if it hits the player, if it hits say a prop or scene or what ever then the damage should be 0. (or if it is a breakable prop apply the damage to the object it picked, that has a keyvalue breakable or something) Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
dennis Posted February 27, 2015 Author Share Posted February 27, 2015 what pick should I use then? the target is determined here: function Script:IsTargetInAttackRange() local pos = self.entity:GetPosition() local targetpos = self.target.entity:GetPosition() if math.abs(targetpos.y-pos.y)<self.attackRange then if pos:xz():DistanceToPoint(targetpos:xz())<self.attackRange then return true end end return false end and the attack is started here: elseif self.mode=="attack" then if self.attackbegan~=nil then if t-self.attackbegan>300 then self.attackbegan=nil self.target:Hurt(self.damage) end end local pos = self.entity:GetPosition() local targetpos = self.target.entity:GetPosition() local dx=targetpos.x-pos.x local dz=targetpos.z-pos.z self.entity:AlignToVector(-dx,0,-dz) end I tried to put the attack before "if self.attackbegin~=nil then" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.