ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:16 PM |
Ok so, this is part of a larger script, the whole script works fine but it won't damage NPC's, only characters. This is for a gun. local humanoid=hit.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie") if humanoid~=nil then local eplr=game.Players:playerFromCharacter(humanoid.Parent) local plr=game.Players:playerFromCharacter(thetool.Parent) if eplr~=nil and plr~=nil then if plr.TeamColor ~= eplr.TeamColor then local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25)) tagHumanoid(humanoid) mousee.Icon = hitshot if hit.Name=="Head" then damage=damage*9 print("headshot") humanoid:takeDamage(damage) elseif hit.Name=="Torso" then print("torsoshot") damage=damage*.25 humanoid:takeDamage(damage) else print("shot") damage=damage*.25 humanoid:takeDamage(damage) end end end end
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
|
| 01 Dec 2014 09:18 PM |
Do not use :TakeDamage() for AIs.
Use humanoid.Health = humanoid.Health - damage |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:25 PM |
k thx lemme test
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:30 PM |
It didn't work, but the script is still functional, just doens't damage AI's.
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:33 PM |
*doesn't
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:47 PM |
Help?...
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
|
| 01 Dec 2014 09:51 PM |
local humanoid=hit.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie")
Why not seperate them? |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:51 PM |
Hmm...
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 09:57 PM |
I don't see how separating it would fix it though.
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 10:00 PM |
i did something, still not damaging AI's though. local humanoid=hit.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie") if humanoid~=nil then local eplr=game.Players:playerFromCharacter(humanoid.Parent) local plr=game.Players:playerFromCharacter(thetool.Parent) if eplr~=nil and plr~=nil then if plr.TeamColor ~= eplr.TeamColor then local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25)) tagHumanoid(humanoid) mousee.Icon = hitshot if hit.Name=="Head" then damage=damage*9 elseif hit.Name=="Torso" then else damage=damage*.25 end end end end
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 01 Dec 2014 10:08 PM |
rip scripting helpers
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
| |
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 02 Dec 2014 01:55 AM |
local eplr=game.Players:playerFromCharacter(humanoid.Parent) local plr=game.Players:playerFromCharacter(thetool.Parent) if eplr~=nil and plr~=nil then
Something tells me you either didn't make this, or have no clue what you're doing. |
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 02 Dec 2014 06:15 PM |
I have no clue what i'm doing.
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2014 06:56 PM |
I am a noob when it comes to scripting but, why are there so many "end."
|
|
|
| Report Abuse |
|
|
ZeveI
|
  |
| Joined: 29 Sep 2012 |
| Total Posts: 8003 |
|
|
| 03 Dec 2014 11:45 AM |
So that it ends that line of code?... Anyways, help?...
too fergielicious for u kids |
|
|
| Report Abuse |
|
|
adeep
|
  |
| Joined: 06 Feb 2010 |
| Total Posts: 274 |
|
| |
|