|
| 29 Jun 2015 07:24 PM |
| How would I make that if a NPC wants to damage someone with a sword or nothing, they do an attack animation? |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2015 07:25 PM |
| And I want them when then slash and lunge, it damages. |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2015 07:34 PM |
| The animations I talk about NPCs are in Field of Battle. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jun 2015 08:46 PM |
| Forever alone -SuperRoblox893 |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jun 2015 06:16 AM |
| been a night and still no response |
|
|
| Report Abuse |
|
|
Glaecium
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 7720 |
|
|
| 30 Jun 2015 06:33 AM |
ik how to make animations but i do not know how to use them sorry m8 :/
"DAVID STAY THE HELL AWAY FROM MY BABY" ~rached65 6/26/2015 |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 06:35 AM |
| ik how to make them too but cant use them |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 08:42 AM |
| if i dont have any suggestions i would have to cancel my project.. |
|
|
| Report Abuse |
|
|
| |
|
Vesqueral
|
  |
| Joined: 30 Jan 2015 |
| Total Posts: 2336 |
|
|
| 30 Jun 2015 04:48 PM |
Here, use this fm code I made a while ago
local AI = {};
AI.torso = script.Parent.Torso; AI.hum = script.Parent.Humanoid; AI.targ = nil; AI.los = 100; AI.connections = {};
function AI:getClosestHum(prList) local list = prList or game.Players:GetPlayers(); local closest = self.los; local torso; for _,hum in pairs(list) do if hum and hum.Parent then local dist = (hum.Character.Torso.Position - self.torso.Position).magnitude; if dist <= closest then closest = dist; torso = hum.Character.Torso end -- set closest to the distance and the torso as the new closest torso. end end return torso, closest end
function AI:isClose(dist) if dist < 10 then return true end end
function AI:move(pos) print("Ran") self.hum:MoveTo(pos); end
function AI:discon() for _,v in pairs(self.connections) do if v then v:disconnect() end end end
function AI:mainLoop() while wait(1) do local con; self:discon() self.targ,dist = self:getClosestHum(); if self.targ then self:move(self.targ.Position) table.insert(self.connections,con); if self:isClose(dist) then self.targ.Parent.Humanoid:TakeDamage(10 - -dist) end -- add damage closer to target end end end
coroutine.resume(coroutine.create(function()AI:mainLoop()end))
Just put it in a humanoid, it won't animate, you'll have to edit it for that |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 06:30 PM |
| K, I will try it tomorrow will it work with the npc with the sword too? |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2015 06:37 PM |
| I want to change the damage of the NPC I think you have to edit the damage at a line that says 10 |
|
|
| Report Abuse |
|
|