#Need help with killers not killing eachother
50 messages · Page 1 of 1 (latest)
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?
@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
** You are now Level 5! **
if not then just change the killer's humanoid name
yup
^
I did but than they wont walk
they just stand still
where you tried getting players magnitude
im sorry I cant script i took the killer from models bc it looks like a funny killer to me
make list game.Players:GetChildren()
you need to learn to script bruh
just change the list variable
to what i said before
where is it..
please refrain from using free models
;noob-scripter
wrong server
anyway
just learn because you don't seem to know anything
do you know what a variable is
yes
give an example
its like you use an = or - in a script something like that
** You are now Level 5! **
look please just learn scripting instead of using free models
not even knowing what a variable is
is very dangerous
why
your telling me to change the local List = game.Workspace:children() into a local List = game.Players:GetChildren()
yes
okay
oh ty
but can you maybe tell me what to do now @median heron
learn scripting
