RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make a enemy pathfinding script and when the enemy touches the player it disappears"
-- server script local pfs = game:GetService("PathfindingService") local enemy = game.Workspace.Enemy local player = game.Players.LocalPlayer local path = pfs:CreatePath() path:ComputeAsync(enemy.HumanoidRootPart.Position, player.Character.HumanoidRootPart.Position) for _, waypoint in pairs(path:GetWaypoints()) do enemy.Humanoid:MoveTo(waypoint.Position) enemy.Humanoid.MoveToFinished:Wait() end enemy.Touched:Connect(function(otherPart) if otherPart.Parent == player.Character then enemy:Destroy() end end)