generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Player and Zombie damaging gun [BUG]

Previous Thread :: Next Thread 
hawk2eye is not online. hawk2eye
Joined: 03 May 2010
Total Posts: 8525
27 Sep 2014 04:49 AM
What do I need to add to the lines and where to make the gun damage the zombie as well? If you do help thanks, if not just don't make any witty remarks thanks.

function Fire(Mouse)
local Spread = CFrame.Angles(math.rad(math.random(-Settings.Spread, Settings.Spread)/10), math.rad(math.random(-Settings.Spread, Settings.Spread)/10), math.rad(math.random(-Settings.Spread, Settings.Spread)/10))
local Ray = Ray.new(Character.Head.Position, (CFrame.new(Character.Head.Position, Mouse.Hit.p) * Spread).lookVector.unit * Settings.Range)
local Hit, Pos = Workspace:FindPartOnRayWithIgnoreList(Ray, Ray_Ignore)
if Hit and Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent:FindFirstChild("Zombie")then
local Hit_Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Settings.AntiTK and Hit_Player.TeamColor == Player.TeamColor then
return
end
local Humanoid = Hit.Parent.Humanoid
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = Player
game.Debris:AddItem(c, 3)
c.Parent = Humanoid
if Hit.Name == "Head" then
Humanoid.Health = Humanoid.Health - math.random(Settings.HeadShotDamage[1], Settings.HeadShotDamage[2])
else
Humanoid.Health = Humanoid.Health - math.random(Settings.Damage[1], Settings.Damage[2])
end
Report Abuse
hawk2eye is not online. hawk2eye
Joined: 03 May 2010
Total Posts: 8525
27 Sep 2014 04:51 AM
Anyone?
Report Abuse
hawk2eye is not online. hawk2eye
Joined: 03 May 2010
Total Posts: 8525
27 Sep 2014 05:19 AM
Ok...
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
27 Sep 2014 05:20 AM
Why did you create another post?
Report Abuse
hawk2eye is not online. hawk2eye
Joined: 03 May 2010
Total Posts: 8525
27 Sep 2014 05:22 AM
I was told I had a misleading title on the other so here I am.
Report Abuse
hawk2eye is not online. hawk2eye
Joined: 03 May 2010
Total Posts: 8525
27 Sep 2014 05:36 AM
Ok.
Report Abuse
FoLBot is not online. FoLBot
Joined: 08 May 2014
Total Posts: 168
27 Sep 2014 06:47 AM
Check the other one. I fixed your problem
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image