I want to make a bot that kills players but how do i do it?
COMMUNITY QUESTION
How do i script a bot that kills players?
2 answers
Try using the "PathfindingService" more info about it here https://developer.roblox.com/en-us/articles/Pathfinding
This is not a request site. However, I could link pages to help.
First, you'd use PathfindingService to make the bot follow the player.
Next, (and last) you need to make the bot damage the player; this can be done via combining .Touched and :TakeDamage.
--Damaging part example
HumanoidRootPart.Touched:Connect(function(object)
if object.Parent:FindFirstChild("Humanoid") then
local player = object.Parent
player.Humanoid:TakeDamage(100)
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
