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 » Scripters
Home Search
 

Re: HELP! *URGENT*

Previous Thread :: Next Thread 
ZeveI is not online. 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
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
01 Dec 2014 09:18 PM
Do not use :TakeDamage() for AIs.

Use humanoid.Health = humanoid.Health - damage
Report Abuse
ZeveI is not online. 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 is not online. 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 is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
01 Dec 2014 09:33 PM
*doesn't

too fergielicious for u kids
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
01 Dec 2014 09:47 PM
Help?...

too fergielicious for u kids
Report Abuse
GeoVolcano is not online. GeoVolcano
Joined: 05 Jul 2012
Total Posts: 1433
01 Dec 2014 09:51 PM
local humanoid=hit.Parent:FindFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie")

Why not seperate them?
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
01 Dec 2014 09:51 PM
Hmm...

too fergielicious for u kids
Report Abuse
ZeveI is not online. 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 is not online. 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 is not online. 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 is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
01 Dec 2014 10:20 PM
UP
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
01 Dec 2014 10:35 PM
UP
Report Abuse
eLunate is not online. 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 is not online. 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
WaltonFountian is not online. WaltonFountian
Joined: 26 Mar 2014
Total Posts: 625
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 is not online. 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 is not online. adeep
Joined: 06 Feb 2010
Total Posts: 274
03 Dec 2014 11:47 AM
Learn Lua
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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