Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
I need a chase script that does not kill another chaser. As in, a chasing bunny will not chase nor kill another fellow bunny. Can anyone make a script like that? |
|
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
Bump |
|
Cole2Join Date: 2007-10-04 Post Count: 1758 |
Actally, it is totally impossible. Because on touch, the script looks for Humanoid, and sets Health to value 0. |
|
WaffleBoyJoin Date: 2007-03-21 Post Count: 1377 |
Then rename Humanoid. Duh. |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
That or I can make the Bunny's Health 100,000,000,000,000,000 and make the script decrease your health by 100. Since the Bunny's health is so high, it would take alot of hits for it to die. Thx for reminding me.
Then again, you could add a few lines so the script looks for the name first. If it isn't 'Bunny', then it would kill the person.
As for the bunnies chasing each other, I'll name their Torsos Torso2, and change their chase script so they'll still move.
I'm gonna try those out. Thanks for the ideas =D |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
Uhhh, just saw Waffle's post, clever idea, thanks. You're awesome =D |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
It didn't work. Oh well. Bump. |
|
koontayJoin Date: 2007-03-08 Post Count: 1371 |
I thought everyone knew thought renaming th ehumanoid didn't work...
(K) |
|
burglyTop 100 PosterJoin Date: 2006-08-20 Post Count: 2843 |
well clockwork has done it, so this is possible. |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
Yeah, too bad he didn't release it. So now, one of my choices left is to...
SPAM CLOCKWORK! SPAM CLOCLWORK! SPAM- *Gets hit on the head by a teapot*
Nah. I just need someone to modify the script so it looks for the name "Bunny" first. Then if it's "Bunny", it doesn't follow nor hurt it. Someone do it for me plox? |
|
|
burglyTop 100 PosterJoin Date: 2006-08-20 Post Count: 2843 |
has anyone tryed removing the chaser's humanoid? |
|
burglyTop 100 PosterJoin Date: 2006-08-20 Post Count: 2843 |
that would of course, make it undelfeatable... |
|
|
Then you wont be able to kill the chaser |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
Considering the fact that renaming the humanoid didn't work, I don't think removing it will. The chase script needs the humanoid to work. |
|
|
burglyTop 100 PosterJoin Date: 2006-08-20 Post Count: 2843 |
i've tried re-naming the torso, it doesn't moave then. |
|
|
I have made a working script that accomplishes this, although it has a few bugs. Mainly that it doesn't recieve a new atrget, after killing the previous one. Feel free to use this script, or adapt it as you need. Simply insert it into a figure such as a zombie.
You may be able to solve the previous bug if you cause the zombie to clone itself after killing another humanoid, then immediately after, killing itself.
--------------------------------------------------------------------------------
zombie = script.Parent
zombie.Torso.BodyPosition.position = zombie.Torso.Position
wait(1)
debug = false
ai = true
function target()
players = game.Players:children()
if(#players ~= 0) then
myTarget = players[math.random(1,#players)].Character.Torso
else
ai = false
wait (5)
ai = true
end
end
target()
function moveKillbot()
if(ai == false) then return end
local dir = Vector3.new(0,0,0)
if (myTarget ~= nil) then
dir = (myTarget.Position - zombie.Torso.Position).unit
zombie.Torso.CFrame = CFrame.new(zombie.Torso.Position, myTarget.Position)
end
zombie.Torso.BodyPosition.position = zombie.Torso.Position + (dir * 20)
end
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
humanoid.Health = humanoid.Health - 100
ai = false
wait(5)
ai = true
target()
end
end
children = zombie:children()
for i=1,#children do
if(children[i].className == "Part") then children[i].Touched:connect(onTouched) end
end
target()
for n=1,10 do
if(ai == true) then
wait(math.random()*5)
moveKillbot()
end
end
------------------------------------------------------------------------------- |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
The script didn't work. The bunneh didn't move at all =( I think there's something wrong with it. |
|
|
Is the "bunny" a figure? Since this won't work for any brick, just figures with all the required parts. |
|
Rhino1004Top 100 PosterJoin Date: 2007-06-09 Post Count: 4926 |
Oh. Well, I got a better script anyhow, so bleh =P Thx for trying anyhow. |
|
|
If you want, check out my latest model, since I just uploaded the zombie I made. |
|
|
|
Here is just the FindTorso routine from NPC Wait Animation.
Tinkering with the comparisons at the critical line decides what to follow and what to not follow. Yes, checking for the Bunny's name would work. This checks for something witht the same name as us:
function findNearestTorso(pos) -- Find any Humanoid named "Humanoid", not .Named us.
local list = game.Workspace:children()
local torso = nil
dist = AnimateBoundary -- Ninja, this is the Distance a Player must be in to Start Walking Points
local temp = nil -- Ninja this FindNearest is "found" so let me know if there are players it doesn't find.
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) and (temp2.Name ~= script.Parent.Name) then --and (temp2.Name ~= "A.I.") OR BUNNY then -- HERE.
temp = temp2:findFirstChild("Torso")
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 -- closer?
end -- human?
end -- Model? Not us.
end -- All
return torso
end
GL,
Brian
|
|