#Need help with killers not killing eachother

50 messages · Page 1 of 1 (latest)

floral oyster
#

Does someone know how to make killers not kill eachother?? ill send the code

#

function findNearestPlayer(Position)
wait(0.3)
local List = game.Workspace:children()
local Torso = nil
local Distance = 20
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("HumanoidRootPart")
Human = Temp2:findFirstChild("Humanoid")
if (Temp ~= nil) and (Human ~= nil) and (Human.Health > 0) then
if (Temp.Position - Position).magnitude < Distance then
Torso = Temp
Distance = (Temp.Position - Position).magnitude
end
end
end
end
return Torso
end

while true do
local target = findNearestPlayer(script.Parent.HumanoidRootPart.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position, target)
end
end

#

And I also got an humanoid inside the killer do I change the name or what?

median heron
#

@floral oyster should they only kill players?

#

if so, instead get the children from players and find the one with the lowest magnitude and chase that

violet turtleBOT
#

studio** You are now Level 5! **studio

median heron
#

if not then just change the killer's humanoid name

floral oyster
#

they just stand still

median heron
#

show me the script

floral oyster
#

alr

#

what script tho?

median heron
#

where you tried getting players magnitude

floral oyster
#

im sorry I cant script i took the killer from models bc it looks like a funny killer to me

median heron
#

make list game.Players:GetChildren()

floral oyster
#

wdym

median heron
#

you need to learn to script bruh

#

just change the list variable

#

to what i said before

floral oyster
#

where is it..

median heron
#

please refrain from using free models

#

;noob-scripter

#

wrong server

#

anyway

#

just learn because you don't seem to know anything

floral oyster
#

okay but can you tell me where to find the list

#

@median heron

median heron
#

do you know what a variable is

floral oyster
#

yes

median heron
#

give an example

floral oyster
#

its like you use an = or - in a script something like that

violet turtleBOT
#

studio** You are now Level 5! **studio

median heron
#

look please just learn scripting instead of using free models

#

not even knowing what a variable is

#

is very dangerous

floral oyster
#

why

median heron
floral oyster
#

your telling me to change the local List = game.Workspace:children() into a local List = game.Players:GetChildren()

median heron
#

yes

floral oyster
#

okay

median heron
#

theres all the info

floral oyster
#

but can you maybe tell me what to do now @median heron

median heron
#

learn scripting