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
 

Re: This BOT won't take any damage.

Previous Thread :: Next Thread 
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 01:46 PM
I don't know why, but this bot won't take any damage when I try to hurt it with a sword or any weapon that doesn't explode. http://www.roblox.com/alien-item?id=126221503 Can you tell me why the bot can't get killed? its max health is 75, yet some scipt inside of it must be changing that.
Report Abuse
Gogeta is not online. Gogeta
Joined: 25 Nov 2006
Total Posts: 583
12 Aug 2013 01:49 PM
Either the Bot as rebegate regeneration script or the sword isn't inflicting damage upon the humanoid.
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
12 Aug 2013 01:52 PM
Well

use this:

for i, v in pairs (hit.Parent:children()) do

if v:IsA("Humanoid") then
v:TakeDamage(20)
end
end

Your damage scripts probably searches for 'Humanoid'

They couldve easily changed the name
Report Abuse
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 03:25 PM
No I want to inflict damage onto the Bot with a sword or any weapon, but when I try to do that the Bot takes 0 damage, yet its max health is only 70.
Report Abuse
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 03:33 PM
I don't see any reason why I can't kill it with non-explosives that break the joints
Report Abuse
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 03:34 PM
I mean anything but explosives that break the joints
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
12 Aug 2013 03:38 PM
Is :BreakJoints() on the model what you're looking for?
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
12 Aug 2013 03:50 PM
Inside weapon scripts it looks for humanoid, Is the Alien's humanoid named Humanoid?
Report Abuse
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 03:52 PM
No its called zombie...
Report Abuse
forgotoldacount is not online. forgotoldacount
Joined: 24 Sep 2009
Total Posts: 10460
12 Aug 2013 03:56 PM
I found what is causing the trouble this script. Ill paste below, but what I found is changing the name from zombie to humanoid causes the thing to be killable which I want, but the problem is if there are 2 of them they begin attacking each other which they don't do if they're named zombie.

local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")

function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = 1000
local temp = nil
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Right Arm")
human = temp2:findFirstChild("Humanoid")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
end

human = script.Parent:findFirstChild("Humanoid")
if human == nil then human = script.Parent:findFirstChild("Zombie") end

while true do
wait(1)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
human:MoveTo(target.Position, target)
human.TargetPoint = target.Position
end

end
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 01:12 AM
Face EFFIN palm
Replace zombie with Humanoid
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
13 Aug 2013 01:20 AM
ikr
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
13 Aug 2013 01:23 AM
... or you can make it so that the sword searches for "zombie"...
Report Abuse
jd678 is not online. jd678
Joined: 18 Apr 2008
Total Posts: 11529
13 Aug 2013 01:28 AM
I think he should do what Void said

it is also anti-team kill

two birds one stone
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 03:59 PM
Or ye lal

but it would only affect zombies
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