wait(1)

attack = 5
children = game.Workspace.Dummy:GetChildren()
function hitObject(hit)
	if hit.Parent.Humanoid ~= nil then
		hit.Parent.Humanoid.Heath = hit.Parent.Humanoid.Health - attack
	end
end

for i = 1,#children do
	if children[i].ClassName == "Part" then
		children[i].Touched:connect(hitObject())
	end
end



follow =
 false
human = game.Workspace.Dummy.FindFirstChild("Humanoid")




while true do
	if game.Players.Player1.Character:FindFirstChild("Torso") ~= nil then
		if game.Players.Player1.Character.Torso.Position.X - game.Workspace.Titan.Torso.Position.X <= 10 then
			follow = true
		end
	end
	if follow then
		if game.Players.Player1.Character:FindFirstChild("Torso") ~= nil then
		human.WalkToPoint = game.Players.Player1.Character.Torso.Position
		end
	end
	wait(.5)
end

1 comment

0

please help asap